public static async Task <int> UpdateAsync(ossContext context, Mennyisegiegyseg entity) { Register.Modification(context, entity); await context.SaveChangesAsync(); return(entity.Mekod); }
public static async Task ExistsAnotherAsync(ossContext context, Mennyisegiegyseg entity) { if (await context.Mennyisegiegyseg.AnyAsync(s => s.Particiokod == entity.Particiokod && s.Me == entity.Me && s.Mekod != entity.Mekod)) { throw new Exception(string.Format(Messages.NemMenthetoMarLetezik, entity.Me)); } }
public static async Task <int> AddAsync(ossContext context, Mennyisegiegyseg entity) { Register.Creation(context, entity); await context.Mennyisegiegyseg.AddAsync(entity); await context.SaveChangesAsync(); return(entity.Mekod); }
public static async Task DeleteAsync(ossContext context, Mennyisegiegyseg entity) { context.Mennyisegiegyseg.Remove(entity); await context.SaveChangesAsync(); }