WCF Business Entity
Windows Communication Foundation
Here i share a WCF implementation structure with a web application, the structure are devided into 3 solutions with 6 assemblies, this can be changed as per requirement.
As you can see the structure above.
Here we look how to create business entity.
 | Service sample |
| using System;
| | 1:using System.Collections.Generic;
| | 2:using System.Linq;
| | 3:using System.Text;
| | 4:using System.ServiceModel;
| | 5:using System.ServiceModel.Description;
| | 6:using System.Runtime.Serialization;
| | 7:
| | 8:namespace BusinessEntity
| | 9:{
| | 10: // need to add System.Runtime.Serialization ref for [DataContract],[DataMember] attribute.
| | 11:
| | 12: [DataContract]
| | 13: [Serializable]
| | 14: public class Room
| | 15: {
| | 16: int _RoomId;
| | 17: string _RoomName;
| | 18: int _RoomCapacity;
| | 19: double _RoomRate;
| | 20:
| | 21: [DataMember]
| | 22: public string RoomName
| | 23: {
| | 24: get { return _RoomName; }
| | 25: set { _RoomName = value; }
| | 26: }
| | 27:
| | 28:
| | 29: [DataMember]
| | 30: public int RoomId
| | 31: {
| | 32: get { return _RoomId; }
| | 33: set { _RoomId = value; }
| | 34: }
| | 35:
| | 36: [DataMember]
| | 37: public int RoomCapacity
| | 38: {
| | 39: get { return _RoomCapacity; }
| | 40: set { _RoomCapacity = value; }
| | 41: }
| | 42:
| | 43: [DataMember]
| | 44: public double RoomRate
| | 45: {
| | 46: get { return _RoomRate; }
| | 47: set { _RoomRate = value; }
| | 48: }
| | 49:
| | 50: }
| | 51:}
| | 52: |
|
Asp.net, Ado.net, .Net Remoting, .Net
Webservice, SQL, XML, XSLT, WCF, WPF, WWF NHibernate, Ajax, Jquery, DHTML