Coder Social home page Coder Social logo

datamodel's Introduction

Isaac Hoey

About me

  • ๐Ÿ”ญ I'm currently working on applications for financial reporting

Projects

  • Ozym: A web-application for recording and reporting spending and investing activity. Built using Blazor, ASP.NET Core, and Entity Framework Core.
  • DataModel: Methods and classes for defining, accessing, and using metdata for presenation and search.
  • Extensions.Configuration: Writable and encrypted providers for .NET configuration.

Technologies and tools used

  • C#
  • Entity Framework
  • SQL Server
  • SQL Server Reporting Services
  • PowerShell
  • R
  • python

Focus areas

  • Financial/investment data
  • Automation/scripting
  • Data analysis

Contact

LinkedIn

datamodel's People

Contributors

hoeyi avatar

Stargazers

 avatar

datamodel's Issues

Add validation attribute for checking a property is equal to a specific value

Is your feature request related to a problem? Please describe.
Validating collections of objects whose aggregate values must be a certain value are difficult to validation without a custom validator. Instead, it would be useful to have a validation attribute that can be applied to a member that abstracts away the source of the aggregate value.

The idea can be exemplified with the following code:

public IEnumerable<string> Lines { get; }

// The line count must be equal to 5 for the model to be valid.
[ExactValueAttribute(requiredValue: 5)]
public int LineCount => Lines.Count();

Describe the solution you'd like
An attribute derived from ValidationAttribute that implements the required equality check would be the ideal solution.

Add support for deeper-nested properties

Is your feature request related to a problem? Please describe.
It would be interesting to see a solution that supported search by deeply-nested properties. Something like:

class Country
{
    public string Name {get;set;}
}

class Manufacturer
{
    public string Name {get;set;}
    
    public Country HeadquartersCountry {get;set;}
}

class Car
{
    public Manufacturer AutoManufacturer {get;set;}
    
    public Country PlantCountry {get;set;}
}

// Where one could construct something like: 
Expression<Func<Car, bool>> exp = x => Car.AutoManufacturer.HeadquartersCountry.Name == "United States";

At some point though, it would be cool to create a query-like language that would allow the user to write statements and save them as searches. Can this be done safely?

ExpressionBuilder expressions should support searching boolean members

ExpressionBuilder does not support boolean values in search member expressions, even though some comparison operators would allow them.

Add boolean value support to ExpressionBuilder.GetExpression.

Additional context
This may have been omitted on purpose due to issues with converting the input parameter to the appropriate type.

GetSearchableMembers<T> should support metadata classes used with EF-generated code

Using ExpressionBuilder.GetSearchableMembers<T> only works when the property members are decorated with SearchableAttribute. For EF-generated classes, this makes the method unusable because the property decoration occurs in the metadata class.

Optionally, a call to ExpressionBuilder.GetSearchableMembers<T> returns the member metadata if the decoration occurs in the base class or in the metadata class, provided the property name is the same.

Example

// EF-generated code
public partial class Car
{
    public string ModelName { get; set; }
}

// Decorate partial class in separate file so EF DB-first code 
// generator does not overwrite.
[MetadataType(typeof(CarMetdata))] 
public partial class Car
{
}

public class CarMetadata
{
    [Searchable]
    public string ModelName { get; set; }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.