Пример #1
0
        public static async Task <PatronKind> Update(PatronKind patronKindInDatabase, PatronKind patronKind)
        {
            await Database.WriteAsync(realm =>
            {
                patronKindInDatabase.Name        = patronKind.Name;
                patronKindInDatabase.Description = patronKind.Description;
            });

            return(patronKindInDatabase);
        }
Пример #2
0
        public static async Task <PatronKind> Add(PatronKind patronKind)
        {
            await Database.WriteAsync(realm =>
            {
                patronKind.Id = NextId;
                patronKind    = realm.Add(patronKind);
            });

            return(patronKind);
        }
Пример #3
0
 public static async void Delete(PatronKind patronKind)
 {
     await Database.WriteAsync(realm => realm.Remove(patronKind));
 }
Пример #4
0
        public static Task <PatronKind> Update(PatronKind patronKind)
        {
            var patronKindInDatabase = GetAndCheckValid(patronKind.Id);

            return(PatronKindDataAccess.Update(patronKindInDatabase, patronKind));
        }
Пример #5
0
 public static Task <PatronKind> Add(PatronKind patronKind) => PatronKindDataAccess.Add(patronKind);