Beispiel #1
0
        public static Result <string> SelectNameByIndex(int index)
        {
            try
            {
                var name = FakeService.SelectNameByIndex(index);

                return(Result <string> .Success(name));
            }
            catch (Exception ex)
            {
                return(new Result <string>(ex));
            }
        }
Beispiel #2
0
        public static PaginatedResult <string> SelectPaginated()
        {
            var page     = 0;
            var pageSize = 2;

            var totalInDb = FakeService.CountNames();

            var result = FakeService.SelectPaginated(page, pageSize);

            return(PaginatedResult <string> .Success(
                       result,
                       totalInDb,
                       page,
                       pageSize));
        }
Beispiel #3
0
        public static void CheckIfIsOdd()
        {
            for (int i = 0; i < 5; i++)
            {
                var result = FakeService.CheckIfIsOdd();

                if (result.Succeeded)
                {
                    Console.WriteLine(result.Message);
                }
                else
                {
                    Console.WriteLine(string.Join(", ", result.Errors));
                }
            }
        }
Beispiel #4
0
        public static ListResult <string> SelectAllNames()
        {
            var list = FakeService.SelectAllNames();

            return(ListResult <string> .Success(list));
        }
Beispiel #5
0
        public static Result <string> SelectFirstName()
        {
            var firstName = FakeService.SelectFirstName();

            return(Result <string> .Success(firstName));
        }