public void Create(Group newGroup, string regSysName) { var locals = Languages; newGroup.RegionId = Regions.GetKey(regSysName); _entitiesSource.Groups.AddObject(newGroup); foreach (var local in locals) { newGroup.GroupLocals.Add(new GroupLocal { Group = newGroup, LangId = local.Id, Name = newGroup.SysName, Body = String.Empty }); } _entitiesSource.SaveChanges(); }
public void Save(Group group) { _entitiesSource.Groups.Attach(group); _entitiesSource.ObjectStateManager.ChangeObjectState(group, EntityState.Modified); _entitiesSource.SaveChanges(); }
/// <summary> /// Deprecated Method for adding a new object to the Groups EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToGroups(Group group) { base.AddObject("Groups", group); }
/// <summary> /// Create a new Group object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="sysName">Initial value of the SysName property.</param> /// <param name="isActive">Initial value of the IsActive property.</param> /// <param name="regionId">Initial value of the RegionId property.</param> public static Group CreateGroup(global::System.Int32 id, global::System.String sysName, global::System.Boolean isActive, global::System.Int32 regionId) { Group group = new Group(); group.Id = id; group.SysName = sysName; group.IsActive = isActive; group.RegionId = regionId; return group; }