protected override void InitData() { if (!string.IsNullOrEmpty(_userData.UserFarmItemId)) { UserFarmItem userFarmItemData = App.Instance.userRepository.FarmItems[_userData.UserFarmItemId]; Item = _farmItemFactory.Create(userFarmItemData); } }
private void CreateFarmItem(string farmItemId) { _userData.UserFarmItemId = _userData.Id; var userFarmItemData = new UserFarmItem(); userFarmItemData.Id = _userData.UserFarmItemId; userFarmItemData.CatalogDataId = farmItemId; userFarmItemData.Type = App.Instance.userRepository.FarmItems.CollectionName; userFarmItemData.Init(); App.Instance.userRepository.FarmItems.Set(userFarmItemData, this._userData.Id); Item = _farmItemFactory.Create(userFarmItemData); }