示例#1
0
        public static TModel FromUserSettings <TModel>(Data.Model.UserSettings userSettings) where
        TModel : UserSettingsApiModel, new()
        {
            var model = new TModel();

            model.Id = userSettings.Id;
            return(model);
        }
示例#2
0
            public async Task <AddOrUpdateUserSettingsResponse> Handle(AddOrUpdateUserSettingsRequest request)
            {
                var entity = await _context.UserSettings
                             .SingleOrDefaultAsync(x => x.Id == request.UserSettings.Id && x.IsDeleted == false);

                if (entity == null)
                {
                    _context.UserSettings.Add(entity = new Data.Model.UserSettings());
                }
                entity.Name = request.UserSettings.Name;
                await _context.SaveChangesAsync();

                return(new AddOrUpdateUserSettingsResponse()
                {
                });
            }
示例#3
0
 public static UserSettingsApiModel FromUserSettings(Data.Model.UserSettings userSettings)
 => FromUserSettings <UserSettingsApiModel>(userSettings);