예제 #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);