public async Task NewEffectGroup() { using (var db = _databaseService.Open <GameContext>()) { var effectGroupEntity = new ShopEffectGroupEntity { Name = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString() }; db.EffectGroups.Add(effectGroupEntity); await db.SaveChangesAsync(); EffectGroups.Add(new ShopEffectGroup(effectGroupEntity)); } }
public ShopEffectGroup(ShopEffectGroupEntity entity) { Id = entity.Id; Name = entity.Name; Effects = entity.ShopEffects.Select(x => new ShopEffect(x)).ToList(); }
public ShopEffectGroup(ShopEffectGroupEntity entity) { Id = entity.Id; Name = new ReactiveProperty <string>(entity.Name); Effects = new ReactiveList <ShopEffect>(entity.ShopEffects.Select(x => new ShopEffect(this, x))); }