public async Task SaveMboRuleAsync(MboRule mboRule) { using (ISession session = SessionFactory.OpenSession()) using (ITransaction transaction = session.BeginTransaction()) { await session.SaveOrUpdateAsync(mboRule); transaction.Commit(); } }
public async Task <MboRuleBackendDTO> CreateAndSaveMboRule(int idBusinessLevel, byte maxKpis, short year) { var mboRule = MboRule.Create(idBusinessLevel, maxKpis, year); await _repository.SaveMboRuleAsync(mboRule); return(new MboRuleBackendDTO() { Id = mboRule.Id, MaxKpis = mboRule.MaxKpis, Year = mboRule.Year }); }