none
Designing the behaviors of a class in the projects

    Question

  • In my project, we have Presentation Layer DLL, Business logic DLL, Data DLL, Dataaccess layer DLL.

    Data dll is used by both business layer and presentation layer. 

    Now I have a class "Task" in Data DLL. It has the behaviors 'Execute', 'Stop', 'Continue'. Should I implement these behaviors in Business layer or data layer itself?

    Currently we're implementing them outside in Business layer with a separate manager class for it, because these behaviors should talk to Data access layer (database connections). If I include these behaviors as part of original class(Task) instead of a manager class to it, we don't have a reference to data access layer dll in Data Dll.

    How should we solve this problem?

    I'm providing the skeleton of my code in the project here.

    //Data DLL
    public class MyTask
        {
            public string Name { set; get; }
            public int Id { set; get; }
        }
    
    //Business layer DLL
        public interface ITaskManager
        {
            void Execute(MyTask task);
    
            void Stop(MyTask task);
    
            void Continue();
        }
    
        public class MyTaskManager
        {
            public void Execute(MyTask task)
            {
                SqlExecutor executor = new SqlExecutor();
                executor.Run(task.Name);
            }
    
            public void Stop(MyTask task)
            { }
    
            public void Continue()
            { }
        }
    
    //Data access layer DLL
        public class SqlExecutor
        {
            public void Run(string name)
            {
    
            }
        }
    OR
    //Data DLL
    public class MyTask
        {
            public string Name { set; get; }
            public int Id { set; get; }
    
            public void Execute()
            {
                //need reference to the class which is present in data access dll
                SqlExecutor executor = new SqlExecutor();
                executor.Run(this.Name);
            }
    
            public void Stop()
            {
                //need reference to the class which is present in data access dll
            }
    
            public void Continue()
            { 
                //need reference to the class which is present in data access dll
            }
        }

    I don't know why the model is followed. Data class has only properties not methods. Should we add methods to the data class or having a manager class is any benefit?

    Thanks in advance..


    Sunil




    Wednesday, August 28, 2013 4:15 PM

Answers

  • I don't know why you are even talking about a BLL and DAL because you are not trying to use either one in the classical sense.

    What you are talking about are smart business objects. The smart business object in the example of it doing CRUD operations with a database would have all of the public properties, public methods/behavior and private method/behavior  in it  to make it do CRUD operations with the database. It's an independent little machine that can take care of itself. 

    You would have a business object manager that would work with the smart business object acting upon the public properties and methods of the smart business object to do CRUD operations for itself with the database.

    The business object manager would be instantiated new and you would be sending in new SBO(s) and returning them from the manager, or you are going to be sending existing SBO(s) to the manager.

    The smart business object will have all of its public properties and methods within the object and it may have private methods in the object that may be used by its public methods.  The object is going to populate and work with its own properties. And the manager dedicated to the SBO acts upon the SBO's public properties and methods to make it do its CURD operations with the database in this example.

    A DAL is useless in this situation.

     
    Thursday, August 29, 2013 9:30 AM

All replies

  • The Presentation layer should never be in direct contact  with the DAL. The Presentation layer should act upon methods in the BLL objects. And the BLL objects and their methods should act upon DAL objects and their methods. A classlib project for DTO(s) Data Transfer Object should be seen bby all layers and the DTO(s) sent through the layers.

    DTO can be base on auto properties in an object like example in the link.

    http://msdn.microsoft.com/en-us/library/dd293589.aspx

    Wednesday, August 28, 2013 6:33 PM
  • pops, there is auto properties for C# too and you are using them but implement them in DTO.
    Wednesday, August 28, 2013 6:43 PM
  • Yes ofcourse, my presentation layer is not talking to DAL directly. But my problem is where and how to implement part of my business logic that talks to DAL. Should I do it in Business layer or my other dll (Data dll) as I mentioned above in two codes. For me it seems more logical to move it to that individual class instead of manager.

    Sunil


    Wednesday, August 28, 2013 11:30 PM
  • The BLL and DAL I work with deal with CRUD operations Create, Read Update and Delete operations with a database. So that's what this example shows which dealing with an individual database table. The  MVP, MVC and MVVM make the call  to the BLL object to do CRUD operations with its associated DAL object. What your BLL and DAL objects can do something similar but not working with a database. 

    using System.Collections.Generic;
    using BLL.DTO;

    namespace BLL.IBLL
    {
        public interface IArticleManager
        {
            DTOArticle GetArticleTop1();
            DTOArticle GetArticle(int id);
            List<DTOArticle> GetArticles();
            List<DTOArticle> SaveArticles(List<DTOArticle> articles);
            void DeleteArticle(DTOArticle article);
        }
    }

    using System.Collections.Generic;
    using System.Linq;
    using BLL.DTO;
    using BLL.IBLL;

    namespace BLL
    {
        public class ArticleManager : IArticleManager
        {
            #region public methods

            public DTOArticle GetArticleTop1()
            {
                var article = new DAL.Article().GetArticleTop1();

                var dto = new DTOArticle
                {
                    ArticleID = article.ArticleID,
                    AuthorID = article.AuthorID,
                    Title = article.Tille,
                    Body = article.Body
                };

                return dto;
            }

            public DTOArticle GetArticle(int id)
            {
                var article = new DAL.Article().GetArticle(id);

                var dto = new DTOArticle
                              {
                                  ArticleID = article.ArticleID,
                                  AuthorID = article.AuthorID,
                                  Title = article.Tille,
                                  Body = article.Body
                              };
                return dto;
            }

            public List<DTOArticle> GetArticles()
            {
                var articles = new DAL.Article().GetArticles();

                var dtos = articles.Select(article => new DTOArticle
                    {
                        ArticleID = article.ArticleID,
                        AuthorID = article.AuthorID,
                        Title = article.Tille,
                        Body = article.Body
                    }).ToList();

                return dtos;
            }

            public List<DTOArticle> SaveArticles(List<DTOArticle> articles)
            {
                var artcdtos = new List<DTOArticle>();

                var artcupds = (from a in articles.Where(a => a.IsUpdate) select a).ToList();
                var artcadds = (from a in articles.Where(a => a.ArticleID == -1) select a).ToList();

                if (artcupds.Count > 0
                    || artcadds.Count > 0)
                {
                    if (artcupds.Count > 0)
                    {
                        var dtos = artcupds.Select(artc => new DAL.DTO.DTOArticle
                        {
                            ArticleID = artc.ArticleID,
                            AuthorID = artc.AuthorID,
                            Tille = artc.Title,
                            Body = artc.Body
                        }).ToList();

                        new DAL.Article().UpdateArticles(dtos);
                    }

                    if (artcadds.Count > 0)
                    {
                        var dtos = artcadds.Select(artc => new DAL.DTO.DTOArticle
                        {
                            ArticleID = artc.ArticleID,
                            AuthorID = artc.AuthorID,
                            Tille = artc.Title,
                            Body = artc.Body
                        }).ToList();

                        new DAL.Article().AddArticles(dtos);
                    }

                    var returndtos = GetArticles();

                    artcdtos.AddRange(returndtos.Select(dtoArticle => new DTOArticle
                    {
                        ArticleID = dtoArticle.ArticleID,
                        AuthorID = dtoArticle.AuthorID,
                        Title = dtoArticle.Title,
                        Body = dtoArticle.Body,
                        IsUpdate = dtoArticle.IsUpdate
                    }));
                }
                else
                {
                    artcdtos = articles.ToList();
                }

                return artcdtos;
            }

            public void DeleteArticle(DTOArticle article)
            {
                var daldto = new DAL.DTO.DTOArticle { ArticleID = article.ArticleID };
                new DAL.Article().DeleteArticle(daldto);
            }

            #endregion
        }
    }

    using System.Collections.Generic;
    using DAL.DTO;

    namespace DAL.IDAL
    {
        public interface IArticle
        {
            DTOArticle GetArticle(int id);
            DTOArticle GetArticleTop1();
            List<DTOArticle> GetArticles();
            void UpdateArticles(List<DTOArticle> articles);
            void AddArticles(List<DTOArticle> articles);
            void DeleteArticle(DTOArticle article);
        }
    }

    using System.Linq;
    using DAL.IDAL;
    using DAL.Model;
    using DAL.DTO;
    using System.Data.EntityClient;
    using System.Collections.Generic;


    namespace DAL
    {
        public class Article :IArticle
        {
            private const string pcdb = "name=PublishingCompanyEntities";

            public DTOArticle GetArticleTop1()
            {
                var dto = new DTOArticle();

                using (var conn = new EntityConnection(pcdb))
                using (var db = new PublishingCompanyEntities(conn))
                {
                    try
                    {
                        var article = (from a in db.Articles select a).Take(1).First();
                
                        dto.ArticleID = article.ArticleID;
                        dto.AuthorID =  article.AuthorID;
                        dto.Body = article.Body;
                        dto.Tille = article.Title;

                    }
                    finally
                    {
                        conn.Close();
                    }
                }

                return dto; 
            }

            public DTOArticle GetArticle(int id)
            {
                var dto = new DTOArticle();

                using (var conn = new EntityConnection(pcdb))
                using (var db = new PublishingCompanyEntities(conn))
                {
                    try
                    {
                        var article = (from a in db.Articles.Where(a =>
                                                                   a.ArticleID == id)
                                       select a).First();

                        dto.ArticleID = article.ArticleID;
                        dto.AuthorID = article.AuthorID;
                        dto.Body = article.Body;
                        dto.Tille = article.Title;

                    }
                    finally
                    {
                        conn.Close();
                    }
                }

                return dto; 
            }

            public List<DTOArticle> GetArticles()
            {
                var dtos = new List<DTOArticle>();

                using (var conn = new EntityConnection(pcdb))
                using (var db = new PublishingCompanyEntities(conn))
                {
                    try
                    {
                        var articles = (from a in db.Articles select a).ToList();

                        dtos.AddRange(articles.Select(article => new DTOArticle
                        {
                            ArticleID = article.ArticleID,
                            AuthorID = (int) article.AuthorID,
                            Body = article.Body,
                            Tille = article.Title
                        }));
                    }
                    finally
                    {
                        conn.Close();
                    }
                }

                return dtos;
            }

            public void UpdateArticles(List<DTOArticle> articles)
            {
                using (var conn = new EntityConnection(pcdb))
                using (var db = new PublishingCompanyEntities(conn))
                {
                    try
                    {
                        foreach (var article in articles)
                        {
                            var artc = new Model.Article { ArticleID = article.ArticleID };

                            db.AttachTo("Articles", artc);
                            artc.AuthorID = article.AuthorID;
                            artc.Title = article.Tille;
                            artc.Body = article.Body;
                            db.SaveChanges();
                        }
                    }
                    finally
                    {
                        conn.Close();
                    }
                }
            }

            public void AddArticles(List<DTOArticle> articles)
            {
                using (var conn = new EntityConnection(pcdb))
                using (var db = new PublishingCompanyEntities(conn))
                {
                    try
                    {
                        foreach (var article in articles)
                        {
                            var artc = new Model.Article
                                           {
                                               AuthorID = article.AuthorID,
                                               Title = article.Tille,
                                               Body = article.Body
                                           };

                            db.AddToArticles(artc);
                            db.SaveChanges();
                        }
                    }
                    finally
                    {
                        conn.Close();
                    }
                }
            }

            public void DeleteArticle(DTOArticle article)
            {
                var art = new Model.Article { ArticleID = article.ArticleID };

                using (var conn = new EntityConnection(pcdb))
                using (var db = new PublishingCompanyEntities(conn))
                {
                    try
                    {
                        db.AttachTo("Articles", art);
                        db.DeleteObject(art);
                        db.SaveChanges();
                    }
                    finally
                    {
                        conn.Close();
                    }
                }
            }
        }
    }

    Thursday, August 29, 2013 12:43 AM
  • Do not put DataAccess into your Data.DLL. It is fine to put DataAccess in the Business.DLL. The Data.DLL is probably used by your UI (or should be anyway).

    ~~Bonnie Berent DeWitt [C# MVP]

    http://geek-goddess-bonnie.blogspot.com

    Thursday, August 29, 2013 1:46 AM
    Moderator
  • I really don't understand, what you're trying to say!!!

    Sunil

    Thursday, August 29, 2013 5:55 AM
  • Yes. That's why we had a separate manager for that class. But I need to instantiate manager and pass the object to it to perform operations every time. But these behaviors belong to that object, I could have directly invoked on them. 

    Sunil

    Thursday, August 29, 2013 5:58 AM
  • I don't know why you are even talking about a BLL and DAL because you are not trying to use either one in the classical sense.

    What you are talking about are smart business objects. The smart business object in the example of it doing CRUD operations with a database would have all of the public properties, public methods/behavior and private method/behavior  in it  to make it do CRUD operations with the database. It's an independent little machine that can take care of itself. 

    You would have a business object manager that would work with the smart business object acting upon the public properties and methods of the smart business object to do CRUD operations for itself with the database.

    The business object manager would be instantiated new and you would be sending in new SBO(s) and returning them from the manager, or you are going to be sending existing SBO(s) to the manager.

    The smart business object will have all of its public properties and methods within the object and it may have private methods in the object that may be used by its public methods.  The object is going to populate and work with its own properties. And the manager dedicated to the SBO acts upon the SBO's public properties and methods to make it do its CURD operations with the database in this example.

    A DAL is useless in this situation.

     
    Thursday, August 29, 2013 9:30 AM
  • oh got it.. I want to route the calls from my object to the business layer. So I need to reference Business layer DLL in my Data dll. But it'll make circular reference as I'll have reference to my Data dll in business layer. Meanwhile what's CURD you keep mentioning?

    Sunil




    Thursday, August 29, 2013 4:06 PM
  • Create, Read, Update and Delete  -- > CRUD......

    How can you have a circular reference if all of it is in the Business Layer, the Manager and  the Business Objects with the Business Objects having all the needed public properties and methods in the object  to do what is needed for the Business Object itself. The Business object Manager object only directs the BO what it suppose to do.

    Hey BO Manager I want a BO. I want a you to create it new, make it populate itself by using the BO's methods properties and return the BO.

    Hey BO Manager here is a BO. I want you to act upon the BO's public properties and methods to make the BO persist itself to a data stor.  

    The Presentation layer works/acts upon the public methods of the Manager to get a BO from the Manager and work with it at the Presentation layer,  or the Presentation layer has worked with the BO and it is sending it back to the Manager and the Presentation Layer acts upon the Manager's methods than in turn acts upon the BO's methods to make the BO persist itself.   

    You talk about a Presentation layer,  BLL, and a DAL, but I feel that you are totally confused as to what is going on with the design patterns.  

    Maybe the link can help you with the basics concepts of a Presenter and Controller, the MVP design pattern can be used with a ASP.NET UI, Windows Form UI, Sliverlight UI or WPF UI that's how versatile MVP is.

    http://polymorphicpodcast.com/shows/mv-patterns/

    Hopefully if you watch the show and look at the code, you can pull it altogether.

    HTH

    Good luck to you....

    Thursday, August 29, 2013 5:27 PM
  • We have four dlls.

    Presentation layer -> references Data dll, Business layer dll

    Business layer -> references Data access layer, Data dll

    Data dll -> holds the classes of data used in the project

    Data access layer -> talks to DB


    Sunil

    Thursday, August 29, 2013 5:34 PM
  • Presentation layer -> references Data dll, Business layer dll

    Business layer -> references Data access layer, Data dll

    ------------------------------------------------------------

    Data dll -> holds the classes of data used in the project

    The above are DTO(s) Data Transfer Objects

    http://en.wikipedia.org/wiki/Data_transfer_object

    ---------------------

    Data access layer -> talks to DB

    You are missing a layer which is being talked about in the MVP link I gave you.

    UI

    Presentation layer

    BLL

    Service Layer

    DAL

    Model (the database)

    Or

    UI

    Presentation Layer

    Service Layer

    BLL

    DAL

    Model (the database)

    If you don't understand the basic design pattern, then how can you make it work?

    Thursday, August 29, 2013 5:57 PM
  • Contrary to some beliefs, The Model is not the Database!  The Model represents the State of the Business, The Business Rules and Business Behaviors.

    In an N -Tiered application, interests are separated by the Presentation Level, One or more Business Layers, and one or more State Persistence Layers.  The most common of these patterns is the 3 Tiered solution that has a Presentation Layer, A Business Layer (with one or more Models) and a Persistence (one or more Data Stores) Layer.

    Presentation Layer communicates with the Business Layer Only!

    Business Layer Communicates with the Presentation Layer and the Persistence Layer.

    The Persistence Layer communicates with the Business Layer only!

    In the MVC, MVP and MVVM patterns the View and Controller are part of the Presentation Layer and they communicate with Models (Business Layer Objects).  IN these patterns only the Business Layer has knowledge of the Persistence layer.

    In these scenarios mentioned above, the presentation layer should know nothing about any of the data stores (Presentation Layer).  They only need to know about the Models or the facade classes in the Business Layer.

    With that said, and looking at the code presented in the original post:

    I assume the the Execute, Stop, and Continue operations are exposed as UI Choices and when selected are in the context of a particular Task Class instance.

    The Task is a Business Object. It should contain the Behaviors that affect it's state (Execute, Stop and Continue)

    Each Instance of a Task when created should know it's purpose when created (name and id in constructor) and, I presume, should know it's state (Executing, Stopped, Completed???)

    A collection of Task Instances should be exposed by the Business Layer to be selected through the Presentation Layer for selection and manipulation.

    The Task Itself, as a Business Layer Object should  have knowledge of the Persistence Layer and the behaviors of the Business and Presentation Layers that it requires.

    The Manager (Is there a UI ??) becomes the View-Controller of the Tasks(Model) in a MVC.

    This solves the Whole discussion (In my Humble Opinion) by just adhering to basic design patterns.  Of course the details might vary based upon your actual requirements, the pattern rules do not change.

    Ibrahim


    Ibrahim Malluf MCP http://www.malluf.com


    • Edited by Ibrahim Y Thursday, August 29, 2013 7:28 PM
    • Proposed as answer by Ibrahim Y Thursday, August 29, 2013 7:29 PM
    Thursday, August 29, 2013 7:25 PM
  • <copied>

    Contrary to some beliefs, The Model is not the Database!  The Model represents the State of the Business, The Business Rules and Business Behaviors.

    <end>

    This kind of tells me that you have not worked with an Object Relational Mapping solution like nHibernate, or Entity Framework and the virtual model in a N-Tier solution.

    http://msdn.microsoft.com/en-us/data/entity-framework-model-first.aspx

    And the Business Layer I consider it to be the Domain Model in Domain Driven Design.

    http://en.wikipedia.org/wiki/Domain_model

    And the UI interface the forms are in contact with the Presentation layer,  and the UI the Forms are dumb forms with responsibilities passed off to the presenter.

    Typical UI form code using the Presenter. Actually, I just took the tutorial and made it use N-Tier with WCF WEB service with BLL and DAL sitting behind the WCF Web Service using EF for giggles, grins and kicks. 

    Then I went back into work and laid down what I wanted done a few years back.

    http://www.codeguru.com/csharp/csharp/net30/article.php/c15489/ADONET-Entity-Framework-Tutorial-and-Basics.htm

    using System;
    using System.Collections.Generic;
    using System.Windows.Forms;
    using BLL.DTO;
    using DemoWindowsFormApp.Presenters;
    using DemoWindowsFormApp.Views;
    using Services;

    namespace DemoWindowsFormApp
    {
        public partial class ArticleView : Form, IArticleView
        {
            #region Members
            private ArticleViewPresenter mPresenter;
            #endregion

            public ArticleView()
            {
                mPresenter = new ArticleViewPresenter(this, TheService1.Instance);
                InitializeComponent();
            }

            public int Idx { get; set; }

            public List<DTOArticle> DtoArticles { get; set; }
           
            public Label LblArticleId
            {
                get { return lblArticleID; }
                set { lblArticleID = value; }
            }

            public TextBox TbxTitle
            {
                get { return tbxTitle; }
                set { tbxTitle = value; }
            }

            public TextBox TbxBody
            {
                get { return tbxBody; }
                set { tbxBody = value; }
            }

        
            private void ArticleView_Load(object sender, EventArgs e)
            {
                mPresenter.Load();
            }

            private void btnFirst_Click(object sender, System.EventArgs e)
            {
                mPresenter.btnFirstClick();
            }

            private void btnPrev_Click(object sender, EventArgs e)
            {
                mPresenter.btnPrevClick();
            }

            private void btnNext_Click(object sender, EventArgs e)
            {
                mPresenter.btnNextClick();
            }

            private void btnLast_Click(object sender, EventArgs e)
            {
                mPresenter.btnLastClick();
            }

            private void btnUpdate_Click(object sender, EventArgs e)
            {
                mPresenter.btnUpdateClick();
            }

            private void btnClear_Click(object sender, EventArgs e)
            {
                mPresenter.btnClearClick();
            }

            private void btnSaveNew_Click(object sender, EventArgs e)
            {
                mPresenter.btnSaveNewClick();
            }

            private void btnDelete_Click(object sender, EventArgs e)
            {
                mPresenter.btnDeleteClick();
            }

            private void btnSubmit_Click(object sender, EventArgs e)
            {
                mPresenter.btnSubmitClick();
            }
        }
    }

    using System.Collections.Generic;
    using System.Linq;
    using DemoWindowsFormApp.Views;
    using BLL.DTO;
    using Services.IServices;

    namespace DemoWindowsFormApp.Presenters
    {
        public class ArticleViewPresenter
        {
            private readonly IArticleView mView;
            private readonly IService1 mService;

            #region constructor

            public ArticleViewPresenter(IArticleView view, IService1  theService)
            {
                mView = view;
                mService = theService;
            }

            #endregion

            #region Public Methods

            public void Load()
            {
                mView.DtoArticles = mService.GetArticles();
                if (mView.DtoArticles.Count > 0)
                {
                    var article = mView.DtoArticles.First();
                    mView.Idx = 0;
                    PopulateFields(article);
                }
            }

            public void btnFirstClick()
            {
                mView.Idx = 0;
                PopulateFields(mView.DtoArticles, mView.Idx);
            }

            public void btnPrevClick()
            {
                if(mView.Idx == 0)
                {
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
                else
                {
                    mView.Idx -= 1;
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
            }

            public void btnNextClick()
            {
                if (mView.Idx == mView.DtoArticles.Count - 1)
                {
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
                else
                {
                    mView.Idx += 1;
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
            }

            public void btnLastClick()
            {
                mView.Idx = mView.DtoArticles.Count - 1;
                PopulateFields(mView.DtoArticles, mView.Idx);
            }

            public void btnUpdateClick()
            {
                var article = mView.DtoArticles[mView.Idx];

                article.Title = mView.TbxTitle.Text;
                article.Body = mView.TbxBody.Text;
                article.IsUpdate = true;
            }

            public void btnClearClick()
            {
                mView.TbxTitle.Text = "";
                mView.TbxBody.Text = "";
                mView.LblArticleId.Text = "Article not saved yet.";
            }

            public void btnSubmitClick()
            {
                var atleastonearticle = (from a in mView.DtoArticles.Where(a => a.IsUpdate
                                         || a.ArticleID == -1)
                                        select a).FirstOrDefault();

                if (atleastonearticle != null)
                {
                    mView.DtoArticles = mService.SaveArticles(mView.DtoArticles);
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
            }

            public void btnSaveNewClick()
            {
                if (mView.TbxBody.Text != ""
                    && mView.TbxTitle.Text != "")
                {
                    var article = new DTOArticle
                                     {
                                         ArticleID = -1,
                                         AuthorID = 1,
                                         Title = mView.TbxTitle.Text,
                                         Body = mView.TbxBody.Text,
                                         IsUpdate = false
                                     };

                    mView.DtoArticles.Add(article);
                    mView.Idx = mView.DtoArticles.Count - 1;
                }
            }

            public void btnDeleteClick()
            {
                if (mView.DtoArticles.Count > 0)
                {
                    var article = mView.DtoArticles[mView.Idx];
                    mService.DeleteArticle(article);
                    mView.DtoArticles.RemoveAt(mView.Idx);
                    mView.Idx = 0;
                    PopulateFields(mView.DtoArticles, mView.Idx);
                }
            }
            #endregion

            #region Private Methods
           
            private void PopulateFields(DTOArticle article)
            {
                mView.LblArticleId.Text = article.ArticleID.ToString();
                mView.TbxTitle.Text = article.Title;
                mView.TbxBody.Text = article.Body;
            }

            private void PopulateFields(List<DTOArticle> articles, int idx)
            {
                var article = articles[idx];

                mView.LblArticleId.Text = article.ArticleID.ToString();
                mView.TbxTitle.Text = article.Title;
                mView.TbxBody.Text = article.Body;
            }

            #endregion
        }
    }

    Thursday, August 29, 2013 8:02 PM