Giter Site home page Giter Site logo

urfnet / urf.core Goto Github PK

View Code? Open in Web Editor NEW
307.0 307.0 60.0 7.74 MB

Unit of Work & Repositories Framework - .NET Core, NET Standard, Entity Framework Core. 100% extensible & lightweight.

Home Page: https://github.com/urfnet

License: MIT License

C# 100.00%
architecture design-patterns dotnetcore entity-framework-core ioc modularity netstandard20 odata productivity repository unitofwork urf webapi

urf.core's People

Contributors

domitnator avatar lelong37 avatar ozbob avatar ozturkfatih avatar tonysneed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

urf.core's Issues

Transactional integrity using oData batch

hi,

I'm trying to use odata's batch functions with net core 2.1.

on API:
...
app.UseODataBatching ();
routeBuilder.MapODataServiceRoute ("ODataRoute", "odata", oDataConventionModelBuilder.GetEdmModel (), new DefaultODataBatchHandler ());

on Client:
...
var responses = await container.SaveChangesAsync (SaveChangesOptions.BatchWithSingleChangeset);

The container calls the various API controllers but the transactional integrity is not managed and if an update goes wrong it does not roll back.

Should UnitOfWork not be responsible for completing the transaction?
Do I have to set some parameters in the api project setup?

Thank you
Ugo

Handling local cache in Repository

Hello,

I do not have the opportunity to ask something here.
But I wanted to know how you solved the problem with reading the Local for Set collection from the context as a issue.

I am using the previous version of the framework (based on EF 6.1.3), where I expanded the Set with the Local() method, in which I can check whether a given entity with the Identity key has already been created.

My problem came from the warehouse economy where individual items of the document transfer goods between warehouses. The commodity which is transferred to the new warehouse has a new resource (entity) created, which is created appropriately for each item.

However, you can choose the same item in two items, which will be double-opened (I want to avoid this situation). In this case, when I process the first document line I create the object, and in the second document position I want to refer to the local memory and read it. When I find the appropriate object, I will be able to update the amount of +=. If I do not find this object then I will want to create it respectively.

Reference to file https://github.com/urfnet/URF.Core/blob/master/URF.Core.EF/Repository.cs

Stored Procedures with URF.Core

Is there any way to use Stored Procedures and binding to complex entity types which is available in URF.Net? If not any workarounds as we have lot of business logic already implemented in SQL Server DB and make use of it for new application development? Or we should go back and use EF6 with URF.Net or the combination of EF6 for SPs and EF Core for regular table entities or some else...

Thanks in advance,
Krishna.

Code in ReadMe

@lelong37 Does the code in the ReadMe need correcting for the Put method? I think it should be _productService.Update(products); vs products.TrackingState = TrackingState.Modified

Post example not working

Hi Guys,

First of all: Thanks for bringing URF to .net core! I liked working with the "old" urf framework a lot!

I am wondering if the Post action in the ODataController is actually working?

image

I created my own project and basically did the same implementation as the sample project but no record is inserted into the (sql server) database eventually.

To make sure it is not a bug i created myself i cloned the sample project (https://github.com/urfnet/URF.Core.Sample) and runned the sample application (and sample api). And again, no record is inserted into the database. I also noticed that there are no unit/integration tests for adding a record to the database via the a service. All the existing service tests are for getting the data (which works perfectly).

Then i cloned the whole urf.core project and created some new tests:

1: Add a ProductLicense (just a simple class) via the repository and save changes:

image

Which works totally fine. A record is inserted into the database.

  1. Add a ProductLicense via the service and then save changes:

image

Which is failing because no record is inserted into the datbase.

But i cannot believe this is an error in the framework. Otherwise other people would have run into this issue too.

But from what i can see is that the Insert is not setting the TrackingState to "added". I says it is "unchanged"

image

Am i the only one who is having troubles with this? I am using .Net core 2.1.4 and .net standard 2.0 and sql server 2016.

Why there is no async Insert and update methods

I am trying to use this framework but when I look into it I have found many async methods but not insert and update my question is that why there is no async insert and update method is there is any logic behind it

FirstOrDefaultAsnyc()

I am trying to get user by email I found following ways to get user using 'FirstOrDefaultAsync()'

public async Task GetUserByEmail(string email)
{
var result = await this.Repository.Query().FirstOrDefaultAsync(x=>x.Email==email, default);
return result;
}
InkedScreenshot_1_LI

public async Task GetUserByEmail_V2(string email)
{
var result = await this.Repository.Query().FirstOrDefaultAsync(x => x.Email == email, new
System.Threading.CancellationToken());
return result;
}

My Question is why we need to pass predicate and cancelation token in extensuion method? Because I never used predicate in FirstOrDefault extension method.

Remove sub entity not working

Hello Anthony,

In your TrackableRepositoryTest, you have a method Task ApplyChanges_Should_Set_Graph_States which adds orderdetails to order with order.OrderDetails.Add(addedDetail). I am trying a similar operation with .Remove. However the sub entity is not getting removed/deleted.

Do you have an example for the same?

Primary key is not tracked when Insert multiple entity with single SaveChangesAsync() on .Net Core 3.0

Recently we upgrade our API from .Net Core 2.2 to 3.1 and URF.Core.EF.Trackable 2.2.0 to 3.0.0. In .Net Core 2.2 and URF.Core.EF.Trackable 2.2.0 everything was working fine. But after upgrade to URF.Core.EF.Trackable 3.0.0, when we Insert multiple entity and use the first entity Primary Key auto increment Id in others entity Foreign Key reference with single SaveChangesAsync() get the error. After execute Insert statement the Primary Key Id of that Entity is still 0 but in URF.Core.EF.Trackable 2.2.0 it was set to -2147482647.
Is there any plan to fix this issue?
For More : dotnet/efcore#12378
https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.0/breaking-changes#notrackingresolution

How to store Header and Detail relation data?

I'm trying to store Header and Detail relation data using Insert function for URF.Core.Services.

_notificationService.Insert(
new Notifications()
{
ClientId = command.ClientId,
ClientNotificationTemplateId = command.ClientNotificationTemplateId,
ConsumerId = command.ConsumerId,
NotifiationType = command.NotifiationType,
NotificationDetails = new List()
{
new NotificationDetails(){ Body = command.Body, NotifiationType = command.NotifiationType, RecepientAddress = command.RecepientAddress
, Subject = command.Subject, CreatedOn = DateTime.Now, CreatedBy = 123, IsActive = true, IsDeleted = false, TrackingState = TrackingState.Added}
},
Status = command.Status,
CreatedOn = DateTime.Now,
CreatedBy = 602737,
IsActive = true,
IsDeleted = false

            });

Do I have to set some parameters in the service call?

How to use Transactions in this framework

I am trying to use Transactions in this but there is no such example and implementation. whereas in URF.Net there is an implementation of that ass shown below


using System;
using System.Data;
using Repository.Pattern.Repositories;
using TrackableEntities;

namespace Repository.Pattern.UnitOfWork
{
    public interface IUnitOfWork
    {
        int SaveChanges();
        int ExecuteSqlCommand(string sql, params object[] parameters);
        IRepository<TEntity> Repository<TEntity>() where TEntity : class, ITrackable;
        int? CommandTimeout { get; set; }
        void BeginTransaction(IsolationLevel isolationLevel = IsolationLevel.Unspecified);
        bool Commit();
        void Rollback();
    }
}

The current CSharpHelper cannot scaffold literals of type 'Microsoft.EntityFrameworkCore.Metadata.Internal.DirectConstructorBinding'. Configure your services to use one that can.

Since the RC2 version until the official 1.0.0 I got a problem with the migration system with Visual Studio. Once I install the package I get this message when I add migration: The current CSharpHelper cannot scaffold literals of type 'Microsoft.EntityFrameworkCore.Metadata.Internal.DirectConstructorBinding'. Configure your services to use one that can.
I do not have the error message if I use the RC1 version. Did you know what can be done to avoid this error?

Best regards,
David

Missing ThenInclude

In EF6 you could include nested navigation properties using the regular Include method, but in EF Core this is not possible anymore.
Is this usercase supported in URF.Core?

How to save related data from a service?

Hello, is this possible to save related data without the need of creating a service for each children entities?
Let's say you have this post entity:

  1. Post entity have a collection of PostTranslation
  2. Post entity have a collection of PostField
  3. Then PostField also have a collection of PostFieldTranslation

In order to save it all, I have to create a PostService, PostTranslationService, PostFieldService and a PostFieldTranslationService class. They all have in common an insert method.

Then I have to call them all from PostService:

First => this.Insert(post);
Then => postTranslationService.Insert(post.PostTranslations);
And then => postFieldService.Insert(post.PostFields, postFieldTranslationService);

I wonder if there is a way to tell EntityFramework with URF.Core to insert them all from this.Insert(post).
The version I use from now is 1.0.0-rc1.

Thank you for any advice,

David

Change Track is not happening while using Patch

I was just trying your sample.

First of all, it doesn't update without explicitly specifying _productService.ApplyChanges() before calling unitOfWork.SaveChangesAsync().

Even though I only updated one property it updates every single property in the table.

Am I missing something?

support for multiple context

how to use this framework when you have multiple database to target in same project.

Repository takes Dbcontext but only the last DI registration will be used.

Ex.
services.AddScoped<DbContext, AContext>();
services.AddScoped<DbContext, BContext>();
services.AddScoped<IUnitOfWork, UnitOfWork>();
service.AddScoped<IRepository,Repository();
only BContext will be resolved

any help appriciated.

CancellationToken

Hi Guys,

The Query class (URF.Core.EF\Query.cs) has a bunch of methods. I noticed that for some of the the CancellationToken is set to default but not for all:

image

Is that done with a specific reason?

I'm using the FirstOrDefaultAsync method a lot (for including child properties) and it is quite anoying to supply the CancellationToken everytime.

var shipment = await _service
                .Query()
                .Include(s => s.RMAs)
                .FirstOrDefaultAsync(s => s.Id == id, new System.Threading.CancellationToken());

Thanks in advance,

Alfred

Support for Detach Tracking State

Is there a way to create a Detached TrackingState?

I'm running into a problem where I want to detach a graph of objects but the service/repo seems to only detach the top level entity. When I go to save the entity it complains that another entity with the same id already exists but it should be part of the detached object graph.

My reason for doing this (and perhaps there is a better way, which I'm very open to) is that I want to track/record the changes to certain fields of my entity into another table (ChangeHistory). In order to do that in my API controller I do the following.

               var original = _bulletService.GetById(dto.Id);
               _bulletService.Detach(original);
               if (original == null)
                   return NotFound();

               var bullet = EntityFactory.Parse(original, dto);
               _bulletService.ApplyChanges(bullet);
               _bulletService.Update(bullet);
               await _unitOfWork.SaveChangesAsync();
               _bulletService.AcceptChanges(bullet);

               //-- Save changes to Bullet
               var transactionId = Guid.NewGuid();
               var timeStamp = DateTime.Now;
               var changes = _bulletService.GetChanges(transactionId, timeStamp, original.CompositeKey, _currentUser, original, bullet);
               if (ListUtils.IsNonEmptyList(changes))
               {
                   changes.ForEach(x => _changeRecordService.Insert(x));
                   await _unitOfWork.SaveChangesAsync();
               }

The Parse function creates a copy of the original with the dto information overlain but does not overwrite the original to be used later as in a comparison.

If I could mark each entity in original as not tracked or Detached then I could avoid the error.

Insert called even in update and delete methods

Hi there,

I am a bit confused here.

In your repository code

 public virtual void Insert(TEntity item)
            => Context.Entry(item).State = EntityState.Added;

and at the same time in the Trackable Code

 public override void Insert(TEntity item)
        {
            item.TrackingState = TrackingState.Added;
            base.Insert(item);
        }

        public override void Update(TEntity item)
        {
            item.TrackingState = TrackingState.Modified;
            base.Insert(item);
        }

        public override void Delete(TEntity item)
        {
            item.TrackingState = TrackingState.Deleted;
            base.Insert(item);
        }

Even for Delete and Update methods Insert is called.

[question] Why there is a method to load a reference property but not a method to load a collection property from Repository ?

I have noticed that there is a "generic" method to load a "reference" property but not a "collection" property in the repository code.
I don t understand why there is a distinction and so no generic method for a collection property ?

Actual code for reference property

public virtual async Task LoadPropertyAsync(TEntity item, Expression<Func<TEntity, object>> property, CancellationToken cancellationToken = default)
            => await Context.Entry(item).Reference(property).LoadAsync(cancellationToken);

A proposition for collection property

public virtual async Task LoadCollectionAsync(TEntity item, Expression<Func<TEntity, IEnumerable<object>>> property, CancellationToken cancellationToken = default)
            => await Context.Entry<TEntity>(item).Collection(property).LoadAsync(cancellationToken);

Concurrency Issues URF.Core Applychanges and SaveChanges

I am trying to add data into a table that has Instead of trigger that was throwing DBConcurrency issue which has gone away after adding a select statement as suggested in the below link in the trigger.
https://stackoverflow.com/questions/5820992/error-when-inserting-into-table-having-instead-of-trigger-from-entity-data-frame?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

However getting another errror saying cast error to convert byte[] into string and sometimes string to int (my table has timestamp field with byte[])

any help on this is highly appreciated as I have convinced all my team to go with URF.Core and got stuck with this, now.

Delete on ITrackableRepository

Hi,

Today I was testing with URF.Core..

I created a delete API function to delete a tweet from the database
image

After the function has ran, it gives me an "200" Ok response, but when I check the database, the tweet with id 1 is still there.

Am I doing something wrong?

Repository.GetRepository<T>

Where can I achieve the following URF.NET functionality in URF.Core ?
Getting another repository B from within repository A with this method:

public interface IRepository where TEntity : class, ITrackable
{
...
IRepository GetRepository() where T : class, ITrackable;
}

Abstracting the exceptions

"DbUpdateConcurrencyException" in the example is EF specific. Abstracting ORM exceptions would remove the EF dependency from the business logic layer. That way another ORM or technology could be used in the lower layer. Or did I get something wrong?

Possible SingleOrDefaultAsync issue?

Hi Guys,

I bumped into a really strange issue when working on a project while using URF.core. I noticed that in my unit test a really simpel assert failed. But because there was a lot of custom code involved i first thought it was a mistake on my side so i skipped over it. Today I ran into the same issue again so I updated my fork of urf.core and added a simpel unit test:

[Fact]
        public async Task Product_Should_Not_Be_Null_After_A_Contains_Query()
        {
            // Arrange
            var repository = new Repository<Product>(_fixture.Context);

            // Act
            var products = await repository.Query().Where(p => p.ProductId == 1).SelectAsync();
            
            // Assert
            Assert.NotNull(products);

            // Act
            var product = await repository.Query().SingleOrDefaultAsync(s => s.ProductId == 2, new System.Threading.CancellationToken());

            // Assert
            Assert.NotNull(product);
        }

To my suprise this unit test is failing as well! Am i making a mistake or doing something wierd?

You can clone my fork to see it failing: https://github.com/Domitnator/URF.Core

I believe there is something going wrong in the SingleOrDefaultAsync because if i would replace that line with FindAsync:

[Fact]
        public async Task Product_Should_Not_Be_Null_After_A_Contains_Query()
        {
            // Arrange
            var repository = new Repository<Product>(_fixture.Context);

            // Act
            var products = await repository.Query().Where(p => p.ProductId == 1).SelectAsync();
            
            // Assert
            Assert.NotNull(products);

            // Act
            var product = await repository.FindAsync(2);

            // Assert
            Assert.NotNull(product);
        }

It works!

But it also works when i also request product with id 2 in the first query:

[Fact]
        public async Task Product_Should_Not_Be_Null_After_A_Contains_Query()
        {
            // Arrange
            var repository = new Repository<Product>(_fixture.Context);

            // Act
            var products = await repository.Query().Where(p => new List<int> { 1, 2 }.Contains(p.ProductId)).SelectAsync();
            
            // Assert
            Assert.NotNull(products);

            // Act
            var product = await repository.Query().SingleOrDefaultAsync(s => s.ProductId == 2, new System.Threading.CancellationToken());

            // Assert
            Assert.NotNull(product);
        }

So i'm not quite sure if it has anything to do with the SingleOrDefaultAsync method.

Hopefully you can help me out.

Support for read only repository?

I would like to have support for read only repositories. Implementing something like CQS needs no insert, delete or update in the "Q" part. The injected context could then be an untracked one, which IMHO improves performance.

Delete Action

Hi, I'm new to URF/URF.Core and I used your Northwind example to get started. The Delete Action seems not to work. I run a DELETE http://localhost:2791/odata/Products(77)' via Postman, but that did not delete key 77 from the database (SQLSERVER). Hope you can reproduce the issue or tell me how to execute the Delete Action correctly. Thanks in advance!
urf delete

issue with using AspNetCore.Identity UserManager<IdentityUser> CreateAsync()

having a model like this

public class UserIdentity : IdentityUser
    {
        public virtual TestEntity test { get; private set; }
    }

public class TestEntity : Entity
    {
        public int Id { get; set; }
        public string name { get; set; }
    }

and a service like this

public class UserRegistrationService : IUserRegistrationService
    {
        private readonly UserManager<UserIdentity> _userManager;
        private readonly ITestEntityService _t;

        public UserRegistrationService(IServiceProvider serviceProvider, UserManager<UserIdentity> userManager)
        {
            _userManager = userManager;
            _t = serviceProvider.GetRequiredService<ITestEntityService>();
        }

        public async Task Register(UserRegistrationDto userRegistrationDto)
        {
            var t = new TestEntity{name = "test"};
            _t.Insert(t);
            var newIdentity = new UserIdentity { test = t };
            var result = await _userManager.CreateAsync(newIdentity, userRegistrationDto.Password);
        }
    }

the following exception is thrown calling _userManager.CreateAsync():
SqlException: Cannot insert explicit value for identity column in table 'TestEntities' when IDENTITY_INSERT is set to OFF.

the same happens with a scenario like this:

public class UserIdentity : IdentityUser
    {
        public virtual User User { get; private set; }
        public static UserIdentity CreateIdentity(string username, string email, User newUser, string phoneNumber = "")
        {
            var newUserIdentity = new UserIdentity
            {
                UserName = username,
                Email = email,
                EmailConfirmed = false,
                PhoneNumber = phoneNumber,
                PhoneNumberConfirmed = false,
                User = newUser
            };

            return newUserIdentity;
        }
    }

public class User : Entity
    {
        public string Name { get; set; }
        public string Surname { get; set; }
        public DateTime DateOfBirth { get; set; }
        public virtual Occupation Occupation { get; set; }
        public virtual Country Country { get; set; }
        public virtual City City { get; set; }
        public virtual Ethnicity Ethnicity { get; set; }
        public GenderEnum Gender { get; set; }
    }

and the service that actually I have is:

public UserRegistrationService(IServiceProvider serviceProvider, UserManager<UserIdentity> userManager)
        {
            _userManager = userManager;
            _countryService = serviceProvider.GetRequiredService<ICountryService>();
            _cityService = serviceProvider.GetRequiredService<ICityService>();
            _ethnicityService = serviceProvider.GetRequiredService<IEthnicityService>();
            _occupationService = serviceProvider.GetRequiredService<IOccupationService>();
            _userService = serviceProvider.GetRequiredService<IUserService>();

            _unitOfWork = serviceProvider.GetRequiredService<IUnitOfWork>();
        }

        public async Task Register(UserRegistrationDto userRegistrationDto)
        {
            var newUser = new User();

            var country = GetCountry(userRegistrationDto.CountryName);
            var city = GetCity(country, userRegistrationDto.CityName, userRegistrationDto.CityId.Value);

            var ethnicity = GetEthnicity(userRegistrationDto.EthnicityId.Value);
            var occupation = GetOccupation(userRegistrationDto.OccupationId.Value);

            newUser.Country = country;
            newUser.City = city;
            newUser.Occupation = occupation;
            newUser.Ethnicity = ethnicity;

            newUser.DateOfBirth = userRegistrationDto.DateOfBirth;

            newUser.Name = userRegistrationDto.Name;
            newUser.Surname = userRegistrationDto.Surname;
            newUser.Gender = (GenderEnum)userRegistrationDto.Gender.Value;

            var newIdentity = UserIdentity.CreateIdentity(userRegistrationDto.Email, userRegistrationDto.Email, newUser, userRegistrationDto.Phone);
            var result = await _userManager.CreateAsync(newIdentity, userRegistrationDto.Password);
        }

private Country GetCountry(string countryName)
        {
            if (CountryExistsInDb(countryName))
                return _countryService.Queryable().First(x => x.Name.Equals(countryName));

            var newCountry = new Country { Name = countryName };

            return newCountry;
        }
        private bool CountryExistsInDb(string countryName)
        {
            return _countryService.Queryable().Any(x => x.Name.Equals(countryName));
        }

        private City GetCity(Country country, string cityName, int cityId)
        {
            if (CityExistsInDb(cityId))
                return _cityService.Queryable().First(x => x.CustomCityId == cityId);

            var newCity = new City { CustomCityId = cityId, Country = country, Name = cityName };

            return newCity;
        }
        private bool CityExistsInDb(int cityId)
        {
            return _cityService.Queryable().Any(x => x.CustomCityId == cityId);
        }

        private Ethnicity GetEthnicity(int ethnicityId)
        {
            return _ethnicityService.FindAsync(ethnicityId).Result;
        }

        private Occupation GetOccupation(int occupationId)
        {
            return _occupationService.FindAsync(occupationId).Result;
        }

but this time it tries to insert the Ethnicity, or Occupation, even though they are not new entities.
the exception is:

SqlException: Cannot insert explicit value for identity column in table 'Ethnicities' when IDENTITY_INSERT is set to OFF.
System.Data.SqlClient.SqlCommand+<>c.<ExecuteDbDataReaderAsync>b__122_0(Task<SqlDataReader> result)
System.Threading.Tasks.ContinuationResultTaskFromResultTask<TAntecedentResult, TResult>.InnerInvoke()
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, object state)
System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref Task currentTaskSlot)
Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary<string, object> parameterValues, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)

Extending/Customizing ITrackableRepository<TEntity> and IService<TEntity> for Team & Project Edge Cases

First of all, thank you for your work (and for the new URF.Core)

I have noticed a difference between URF and URF.Core. A lot of synchronous methods (for repository, service and unit of work) are gone.
Of course, the asynchronous methods will have a positive impact on the performance
But often some piece of code need to run synchrone way.
In that case, add an await operator for each instruction has a "negative" impact on the clarity of code (for example: in each test, you need to add an await operator for each method call).

I think this kind of choice should be do at the application level (and not at the framework level). So ideally, the framework should implement synchronous and asynchronous methods.
What are your opinion about this ?

Why do we need Trackable Entity?

Hello, as EF Core already providing the automatic state tracking, why do we need to implement trackable entity? I am not sure if I am missing something here. please shed some light on this area for my better understanding.
Thanks in advance,
Krishna.

Modify Properties to be virtual

Is it possible to change the properties of the class Entity on the namespace URF.Core.EF.Trackable to be virtual? this would help in extending functionality, for example adding a per-property change tracking event.

Automatic tracking state

Do we have any option to determine the state automatically? for e.g. a ProductDTO is received from the consumer and mapped to the Product entity fetched from DB by using Automapper and in this case the Tracking state of the Product entity should be automatically changed to Modified (,if the Product properties are changed by ProductDTO) ? or we should always set the Tracking State manually for each entity? Please advise.

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.