Esempio n. 1
0
 public void Insert(ResourceDto item)
 {
   using (var ctx = ObjectContextManager<PTrackerEntities>.GetManager("PTrackerEntities"))
   {
     var newItem = new Resource
     {
       FirstName = item.FirstName,
       LastName = item.LastName
     };
     ctx.ObjectContext.AddToResources(newItem);
     ctx.ObjectContext.SaveChanges();
     item.Id = newItem.Id;
     item.LastChanged = newItem.LastChanged;
   }
 }
Esempio n. 2
0
 /// <summary>
 /// Create a new Resource object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="lastName">Initial value of the LastName property.</param>
 /// <param name="firstName">Initial value of the FirstName property.</param>
 /// <param name="lastChanged">Initial value of the LastChanged property.</param>
 public static Resource CreateResource(global::System.Int32 id, global::System.String lastName, global::System.String firstName, global::System.Byte[] lastChanged)
 {
     Resource resource = new Resource();
     resource.Id = id;
     resource.LastName = lastName;
     resource.FirstName = firstName;
     resource.LastChanged = lastChanged;
     return resource;
 }
Esempio n. 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Resources EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToResources(Resource resource)
 {
     base.AddObject("Resources", resource);
 }