Пример #1
0
        public ModelMessageResult <RatingModel> handleAdded(RatingModel model)
        {
            var             req    = new RatingFieldsRequest(model);
            IDMessageResult result = APIRequest.createRating(req).GetAwaiter().GetResult();

            Result <RatingModel> get_result = APIRequest.getRatingById(result.Id).GetAwaiter().GetResult();

            return(new ModelMessageResult <RatingModel>(result.Error, result.Message, get_result.Items.FirstOrDefault()));
        }
Пример #2
0
        public static LoginResult attemptSignUp(string username, string password)
        {
            var             req = new UserFieldsRequest(new UserModel(0, username, password, 0));
            IDMessageResult res = APIRequest.createUser(req).GetAwaiter().GetResult();

            if (res.Error != null)
            {
                return(new LoginResult(null, "", res.Error));
            }
            return(attemptLogin(username, password));
        }