Skip to content

jburditt/Generic-Repository

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generic-Repository

See GamifyWorkout Repository for an updated EfRepository with more methods

Generic Repository EF and Web API

I did not write the majority of the code, I simple took 3 existing tools and smashed them together and over time I have learned a lot and work towards a more elegant solution. I have added bug fixes, merged Web API and EF to work from one repository, DTO automation and other various changes.

REFERENCES:

TODO:

  • Add MockRepository

  • Add a working sample project that runs out of the box

  • Add unit testing that demonstrates the sample project

  • Add unit of work pattern to replace 'per method call' scope of context. Context scope should be 'per request'.

  • Add dependency injection and add another ORM e.g. ORMLiteRepository

  • EntityFramework depencies in separate project / assembly, Dapper, ORMLite

  • Evaluate scenario: Find one object that needs to be joined with another object e.g. SELECT u.* FROM User u JOIN Company c ON c.id = u.company_id WHERE c.company_name = @name AND u.status > 0

    • Dapper
  • KeyProperty(Identity = true)] needs to be added by T4 to identity columns

    • Repository
  • update multiple entities matching predicate

  • repository replace filter with predicate, replace include string with include linq

  • replace Repository with DataStore?

    • T4 Generate DTO's
  • Replace !(t.Name == "EFRepository" || t.Name == "WBSEntities") DtoMapper.tt

  • Add [Serializable] to each DTO

  • Add IIdentifier to each DTO or research using KeyValues

  • Add interface : IDTO<countryDTO, country> to each DTO

  • Generate Partial classes

  • Remove circular references

  • Add implicit operator for copying

  • Option for splitting each DTO in to separate files

  • Handle other reserved keywords

  • Does not import System.Int32?

DTO Automation is not 100% complete and requires manually removing circular references to serialize entities.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages