Example #1
0
 public void UpdateState(State state)
 {
     var oldState = GetState(state.Id);
     oldState.Name = state.Name;
     oldState.Region = state.Region;
     oldState.Description = state.Description;
     stateRepo.SaveChanges();
 }
Example #2
0
 /// <summary>
 /// Create a new State object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="regionId">Initial value of the RegionId property.</param>
 /// <param name="objectInfo">Initial value of the ObjectInfo property.</param>
 public static State CreateState(global::System.Int32 id, global::System.String name, global::System.Int32 regionId, ObjectInfo objectInfo)
 {
     State state = new State();
     state.Id = id;
     state.Name = name;
     state.RegionId = regionId;
     state.ObjectInfo = StructuralObject.VerifyComplexObjectIsNotNull(objectInfo, "ObjectInfo");
     return state;
 }
Example #3
0
 public static StateModel FromDomainModel(State state)
 {
     return new StateModel {
         Id = state.Id,
         Name = state.Name,
         Description = state.Description,
         Region = state.Region.Name,
         RegionId = state.RegionId
     };
 }
Example #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the States EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToStates(State state)
 {
     base.AddObject("States", state);
 }