private async Task <DataBaseObjectDummyManyToMany> SaveObjectDummyManyToMany( DataBaseObjectDummyManyToMany obj ) { DataBaseObjectDummyManyToMany result = null; using (var source = CreateDbContext()) { if (obj.Id > 0) { result = await source.DummyManyToMany .FirstAsync(x => x.Id == obj.Id) .CoreBaseExtTaskWithCurrentCulture(false); var loader = new DataBaseLoaderDummyManyToMany(result); loader.LoadDataFrom(obj); } else { var entity = DataEntityObjectDummyManyToMany.Create(obj); var entry = source.DummyManyToMany.Add(DataEntityObjectDummyManyToMany.Create(obj)); result = entry.Entity; } await source.SaveChangesAsync().CoreBaseExtTaskWithCurrentCulture(false); } return(result); }
private ModDummyMainBaseCommonJobOptionItemGetOutput CreateOptionDummyManyToMany( DataEntityObjectDummyManyToMany entity ) { return(new ModDummyMainBaseCommonJobOptionItemGetOutput { Name = entity.Name, Value = entity.Id }); }