public void DeleteUserOrganizationMapping(int memberId, int organizationId) { using (var context = new InThuDoEntities()) { UserOrganizationMappping userOrganizationMap = context.UserOrganizationMapppings.Where(uo => uo.UserId == memberId && uo.OrganizationId == organizationId).FirstOrDefault(); if (userOrganizationMap == null) { return; } context.UserOrganizationMapppings.Remove(userOrganizationMap); context.SaveChanges(); } }
public void InsertUserOrganizationMapping(int memberId, int organizationId) { using (var context = new InThuDoEntities()) { UserOrganizationMappping userOrganization = new UserOrganizationMappping() { OrganizationId = organizationId, UserId = memberId, }; context.UserOrganizationMapppings.Add(userOrganization); context.SaveChanges(); } }
public void InsertUserOrganizationMapping(int memberId, int organizationId) { using (var context = new InThuDoEntities()) { UserOrganizationMappping userOrganization = new UserOrganizationMappping() { OrganizationId = organizationId, UserId = memberId, }; context.UserOrganizationMapppings.Add(userOrganization); context.SaveChanges(); } }