public static PersonFunctionDTO FromRoleEntity(RelationPersonPlayRole relation) { return new PersonFunctionDTO() { PersonId = relation.PersonId, FirstName = relation.Person.FirstName, LastName = relation.Person.LastName, Role = relation.Role }; }
public RelationPersonPlayRole UpdateRelationPersonPlayRole(RelationPersonPlayRole updateData) { throw new NotImplementedException(); }
public RelationPersonPlayRole AddRelationPersonPlayRole(RelationPersonPlayRole newRelationPersonPlayRole) { throw new NotImplementedException(); }
public async Task UpdateRelationPersonPlayRole(RelationPersonPlayRole updateData) { using (var context = new AF_Context()) { try { RelationPersonPlayRole rel = context.RelationsPersonPlayRole.First(r => r.RelationPersonPlayRoleId == updateData.RelationPersonPlayRoleId); context.Entry(rel).CurrentValues.SetValues(updateData); await context.SaveChangesAsync(); } catch (Exception ex) { throw ex; } } }
public async Task AddRelationPersonPlayRole(RelationPersonPlayRole newRelationPersonPlayRole) { using (var context = new AF_Context()) { try { context.RelationsPersonPlayRole.Add(newRelationPersonPlayRole); int recordsAffected = await context.SaveChangesAsync(); } catch (Exception ex) { throw ex; } } }