Free cookie consent management tool by TermsFeed Policy Generator

source: branches/1888_OaaS/HeuristicLab.Services.Optimization.Billing/Utils/StateUtil.cs @ 17116

Last change on this file since 17116 was 9645, checked in by spimming, 11 years ago

#1888:

  • Model classes implement new interface to track current state of entity
  • Mark EntityState property as 'not mapped'
  • Set hook to initialize entity as unchanged
  • Extension method for DbContext to apply changes only on modified entity
File size: 552 bytes
Line 
1using System.Data;
2using HeuristicLab.Services.Optimization.Billing.Interfaces;
3
4namespace HeuristicLab.Services.Optimization.Billing.Utils {
5  public static class StateUtil {
6    public static EntityState ConvertState(State state) {
7      switch (state) {
8        case State.Added:
9          return EntityState.Added;
10        case State.Deleted:
11          return EntityState.Deleted;
12        case State.Modified:
13          return EntityState.Modified;
14        default:
15          return EntityState.Unchanged;
16      }
17    }
18  }
19}
Note: See TracBrowser for help on using the repository browser.