Skip to content

Instantly share code, notes, and snippets.

View rahulsahay19's full-sized avatar
💭
Microservices, Azure, Containers, Kubernetes, Infrastructure, Polyglot, etc

rahul sahay rahulsahay19

💭
Microservices, Azure, Containers, Kubernetes, Infrastructure, Polyglot, etc
View GitHub Profile
if (shippingOptions != null)
{
var selectedOption = shippingOptions.SelectedShippingOptionDetails;
result.SelectedShippingOption = selectedOption;
result.ShowDeliveryMethodInformation = cartResponse.ShippingInfo.RequiresDelivery;
result.ShowSelectedShippingOption = selectedOption != null && !string.IsNullOrEmpty(selectedOption.Id);
if (_contactsSettings.Current.EndUserContact.Mode != ContactSettingsMode.Off)
{
result.ShowEndUserContactInformation = true;
}
@rahulsahay19
rahulsahay19 / Picture31.jpg
Last active August 29, 2015 14:07
WCF Programming 1st
Picture31.jpg
@rahulsahay19
rahulsahay19 / sample class
Last active August 29, 2015 14:07
sample class
public class Employee
{
public string Fname { get; set; }
public string Lname { get; set; }
public string Desig { get; set; }
}
Now, for doing the same, we will add data annotation as shown below in the sample
[DataContract]
@rahulsahay19
rahulsahay19 / Service Contract
Created October 18, 2014 13:30
Service Contract
public interface IEmployee
{
string PrintEmployee(Employee empl);
}
Now, to make the service contract, we need to annotate the same with
different attributes as shown below.
[ServiceContract]
public interface IEmployee
@rahulsahay19
rahulsahay19 / Service Implementation
Created October 18, 2014 13:41
Service Implementation
public class WCFDemo : IEmployee
{
//Service implementation
public string PrintEmployee(Employee empl)
{
// Business Logic goes here...
return string.Format("Hello Employee {0} {1}. Your Designation is {2}", empl.Fname, empl.Lname, empl.Desig);
}
}
@rahulsahay19
rahulsahay19 / Service Behaviour
Created October 18, 2014 13:51
Service Behaviour
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,
ConcurrencyMode = ConcurrencyMode.Multiple)]
public class WCFDemo : IEmployee
{
[OperationBehavior(Impersonation = ImpersonationOption.Required)]
public string PrintEmployee(Employee empl)
{
return string.Format("Hello Employee {0} {1}. Your Designation is {2}", empl.Fname, empl.Lname, empl.Desig);
}
@rahulsahay19
rahulsahay19 / Picture33.jpg
Last active August 29, 2015 14:07
Instance Context
Picture33.jpg
@rahulsahay19
rahulsahay19 / picture 34.jpg
Last active August 29, 2015 14:07
WCF service Demo
picture 34.jpg
@rahulsahay19
rahulsahay19 / Picture 35.jpg
Last active August 29, 2015 14:07
New project
Picture 35.jpg
@rahulsahay19
rahulsahay19 / Sample WCF Implementation
Last active August 29, 2015 14:07
Sample WCF Implementation
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
namespace EmployeeService
{