File Operation

string path = @”D:\IACSD C#\ID.mp4″;
List lstAllowedExtension = new List() { “.txt”, “.xls”, “.csv” };
if (lstAllowedExtension.Contains(Path.GetExtension(path).ToLower()))
{
//Logic For allowed Extension
}
else
{
//Logic For not allowed Extension
}

WCF Concepts

What is WCF?
1)programming platform that is used to build Service-oriented applications
2)programming model for developing, configuring and deploying distributed services.

WCF= Web Services + Remoting +MSMQ +COM+

Microsoft Message Queuing (MSMQ): technology enables applications running at different times to communicate across heterogeneous networks and systems that may be temporarily offline. Applications send messages to queues and read messages from queues.

Sending Application —> Message Queue —–>Receiving Application
basic types of MSMQ queues:
Private —
Public—-published in the active directory.

COM+Component Object Model:
Language-neutral way of implementing objects that can be used in environments different from the one in which they were created, even across machine boundaries.
System.EnterpriseServices

Web Service Common Terminology

Web Service is a business logic component which supports HTTP.
Uses:SOAP to expose business functionality

SOAP: Standardized way to transfer message in the form of XML.
Independent of platform
UDDI: Universal Description Discovery and Intergration.
It is a directory which helps to publish and discover webservice.

DISCO: Microsoft technology for publishing and discovering webservice.

WSDL: Web Service Description Language
defines XML grammar for describing web service (W3C)
SOA: Service Oriented Architecture
The policies, practices, frameworks that enable application functionality to be provided and consumed as sets of services published at a granularity relevant to the service consumer. Services can be invoked, published and discovered, and are abstracted away from the implementation using a single, standards-based form of interface

WS-* Specification:
In order to standardized SOA big companies comes and defined some rules

IC102945

Messaging(WS-Addressing):Free from underlying protocol.
Security(Secuity,Trust,Secure Conversation):
Reliability:
Transactions:
MetaData:

Abstract and Interface

Feature

Interface

Abstract class

Multiple inheritance

A class may inherit several interfaces.

A class may inherit only one abstract class.

Default implementation

An interface cannot provide any code, just the signature.

An abstract class can provide complete, default code and/or just the details that have to be overridden.

Access Modfiers An interface cannot have access modifiers for the subs, functions, properties etc everything is assumed as public An abstract class can contain access modifiers for the subs, functions, properties

Core VS Peripheral

Interfaces are used to define the peripheral abilities of a class. In other words both Human and Vehicle can inherit from a IMovable interface.

An abstract class defines the core identity of a class and there it is used for objects of the same type.

Homogeneity

If various implementations only share method signatures then it is better to use Interfaces.

If various implementations are of the same kind and use common behaviour or status then abstract class is better to use.

Speed

Requires more time to find the actual method in the corresponding classes.

Fast

Adding functionality (Versioning)

If we add a new method to an Interface then we have to track down all the implementations of the interface and define implementation for the new method.

If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly.

Fields and Constants No fields can be defined in interfaces An abstract class can have fields and constrants defined

SQL Server Remove Duplicate Records (Rows) from a Table

WITH tempTable as
(
SELECT ROW_NUMBER() Over(PARTITION BY Name,Position ORDER BY Name) As RowNumber,* FROM EmployeData
)
SELECT * FROM tempTable

WITH tempTable as
(
SELECT ROW_NUMBER() Over(PARTITION BY Name,Position ORDER BY Name) As RowNumber,* FROM EmployeData
)
DELETE FROM tempTable where RowNumber >1
SELECT * FROM EmployeData order by Id asc