コード例 #1
0
        public IHttpActionResult UserProfile(UserIdModel data)
        {
            // kendi profil bilgileri ve kendi postları
            UserInfoApiModel userInfo = new UserInfoApiModel
            {
                Id       = 1,
                Name     = "Ali",
                Surname  = "Basli",
                Email    = "*****@*****.**",
                Birthday = "01-01-1990",
                Gender   = "Male"
            };
            PostsApiModel post = new PostsApiModel();

            post.PostId                = 1;
            post.PostOwnerId           = 1;
            post.PostOwnerProfileImage = File.ReadAllBytes("C:/social/Social/Social/Content/indir.JPG");//imageToByteArray(image1);
            post.PostOwnerNameSurname  = "ali basli";
            post.PostDateTime          = "01.01.1990";
            post.PostTitle             = "New Post";
            post.PostBody              = "the post about being ADAM!";
            post.PostImages            = null;
            List <PostsApiModel> posts = new List <PostsApiModel>();

            posts.Add(post);
            posts.Add(post);

            return(Ok(new
            {
                userInfo = userInfo,
                userPosts = posts
            }));
        }
コード例 #2
0
        public IHttpActionResult UserHome(UserIdModel data)
        {
            PostsApiModel post = new PostsApiModel();

            post.PostId                = 1;
            post.PostOwnerId           = 1;
            post.PostOwnerProfileImage = File.ReadAllBytes("C:/social/Social/Social/Content/indir.JPG");//imageToByteArray(image1);
            post.PostOwnerNameSurname  = "ali basli";
            post.PostDateTime          = "01.01.1990";
            post.PostTitle             = "New Post";
            post.PostBody              = "the post about being ADAM!";

            post.PostImages = new List <byte[]>();
            post.PostImages.Add(File.ReadAllBytes("C:/social/Social/Social/Content/indir.JPG"));

            List <PostsApiModel> posts = new List <PostsApiModel>();

            posts.Add(post);
            posts.Add(post);

            return(Ok(posts));
        }