Beispiel #1
0
        public ModelMessageResult <TagModel> handleAdded(TagModel model)
        {
            var             req    = new TagFieldsRequest(model);
            IDMessageResult result = APIRequest.createTag(req).GetAwaiter().GetResult();

            Result <TagModel> get_result = APIRequest.getTagById(result.Id).GetAwaiter().GetResult();

            return(new ModelMessageResult <TagModel>(result.Error, result.Message, get_result.Items.FirstOrDefault()));
        }
Beispiel #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));
        }