Ejemplo n.º 1
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, BlogServiceBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_CreateBlogUnary, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::BlogPackage.BlogRequest, global::BlogPackage.BlogResponse>(serviceImpl.CreateBlogUnary));
     serviceBinder.AddMethod(__Method_ReadBlogUnary, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::BlogPackage.BlogRequest, global::BlogPackage.BlogResponse>(serviceImpl.ReadBlogUnary));
     serviceBinder.AddMethod(__Method_UpdateBlogUnary, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::BlogPackage.BlogRequest, global::BlogPackage.BlogResponse>(serviceImpl.UpdateBlogUnary));
     serviceBinder.AddMethod(__Method_DeleteBlogUnary, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::BlogPackage.BlogRequest, global::BlogPackage.BlogResponse>(serviceImpl.DeleteBlogUnary));
 }
Ejemplo n.º 2
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(BlogServiceBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_CreateBlogUnary, serviceImpl.CreateBlogUnary)
            .AddMethod(__Method_ReadBlogUnary, serviceImpl.ReadBlogUnary)
            .AddMethod(__Method_UpdateBlogUnary, serviceImpl.UpdateBlogUnary)
            .AddMethod(__Method_DeleteBlogUnary, serviceImpl.DeleteBlogUnary).Build());
 }
Ejemplo n.º 3
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, BlogServiceBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_CreatBlog, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Blog.CreateBlogRequest, global::Blog.CreateBlogResponse>(serviceImpl.CreatBlog));
     serviceBinder.AddMethod(__Method_ReadBlog, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Blog.ReadBlogRequest, global::Blog.ReadBlogResponse>(serviceImpl.ReadBlog));
     serviceBinder.AddMethod(__Method_UpdateBlog, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Blog.UpdateBlogRequest, global::Blog.UpdateBlogResponse>(serviceImpl.UpdateBlog));
     serviceBinder.AddMethod(__Method_DeleteBlog, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Blog.DeleteBlogrequest, global::Blog.DeleteBlogResponse>(serviceImpl.DeleteBlog));
     serviceBinder.AddMethod(__Method_ListBlog, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::Blog.ListBlogRequest, global::Blog.ListBlogResponse>(serviceImpl.ListBlog));
 }
Ejemplo n.º 4
0
 public CommentController(BlogRepositoryBase blogRepository)
 {
     _blogService = new BlogService(this.ModelState, blogRepository);
 }
Ejemplo n.º 5
0
 public CommentController()
 {
     _blogService = new BlogService(this.ModelState);
 }
Ejemplo n.º 6
0
        public ApplicationController(BlogRepositoryBase blogRepository)
        {
            _blogService = new BlogService(this.ModelState, blogRepository);

            ViewData["ArchiveInfo"] = _blogService.ListBlogEntriesByMonth();
        }