This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text.RegularExpressions; | |
namespace DirectoryProblem | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string T = Console.ReadLine().Trim(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Data; | |
using System.Data.SqlClient; | |
using System.Windows.Forms; | |
using SpBrowser.Properties; | |
using System.Diagnostics; | |
using System.Drawing; | |
namespace SpBrowser | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF NOT EXISTS (SELECT * FROM [dbo].[ProductCategories] WHERE [Name] = 'Electronic') | |
INSERT INTO [dbo].[ProductCategories] | |
([ProductCategoryId],[ParentProductCategoryId],[Name],[LastUpdatedBy],[CreatedOn],[UpdatedOn]) | |
VALUES (1, 0, 'Electronic', 1, GETDATE(), GETDATE()) | |
GO | |
IF NOT EXISTS (SELECT * FROM [dbo].[ProductTypes] WHERE [Name] = 'Smart Phone') | |
INSERT INTO [dbo].[ProductTypes] | |
([ProductTypeId],[ProductCategoryId],[Name],[LastUpdatedBy],[CreatedOn],[UpdatedOn]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class Gender | |
{ | |
private readonly char _value; | |
public static readonly Gender Male = new Gender('M'); //Male | |
public static readonly Gender Female = new Gender('F'); //Female | |
public static readonly Gender Unisex = new Gender('U'); //Unisex | |
public static readonly Gender Other = new Gender('O'); //Other | |
private Gender(char v) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Bootstrapper | |
{ | |
public static IWindsorContainer Container { get; private set; } | |
public static void Initialize() | |
{ | |
Container = new WindsorContainer(); | |
Container.AddFacility<WcfFacility>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DogmaticWcf.Server.Contracts | |
{ | |
[ServiceContract] | |
public interface IMyService | |
{ | |
[OperationContract] | |
string DoSomething(MyDto data); | |
} | |
[DataContract] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DogmaticWcf.Server.Contracts | |
{ | |
[ServiceContract] | |
public interface IMyService | |
{ | |
[OperationContract] | |
string DoSomething(MyDto data); | |
} | |
[DataContract] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DogmaticWcf.Server.Services | |
{ | |
public class MyService : IMyService | |
{ | |
public string DoSomething(MyDto data) | |
{ | |
return string.Format("I did something at {0} with {1}", DateTime.Now, data.MyProperty); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main() | |
{ | |
if (Environment.UserInteractive) | |
{ | |
Bootstrapper.Initialize(); | |
Console.WriteLine("Server ready..."); | |
Console.ReadLine(); | |
} | |
else | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DogmaticWcf.Web | |
{ | |
public class ServiceInstaller : IWindsorInstaller | |
{ | |
public void Install(IWindsorContainer container, IConfigurationStore store) | |
{ | |
container.AddFacility<WcfFacility>(); | |
container.Register( | |
Component.For<IMyService>() | |
.AsWcfClient( |
OlderNewer