CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets for: Hadi Eskandari
C#
foreach (Company co in companies)
{
    try //a very weird error here in tests
    {
        //Business logic
    }
    catch { }
}
by Hadi Eskandari   February 10, 2011 @ 2:56am
Tags:
133 Views
no comments
 
XML
<TemplatesExport family="Live Templates">
  <Template uid="a008a808-07e4-4027-9ed7-99167b28a16f" shortcut="dprop" description="Property wrapper that works with a Dependency Property" text="public $type$ $name$&#xD;&#xA;{&#xD;&#xA;   get { return ($type$) GetValue($name$Property); }&#xD;&#xA;   set { SetValue($name$Property, value); }&#xD;&#xA;}" reformat="True" shortenQualifiedReferences="True">
    <Categories />
    <Variables>
      <Variable name="type" expression="fixedTypeName()" initialRange="0" />
      <Variable name="name" expression="suggestVariableName()" initialRange="0" />
    </Variables>
    <CustomProperties />
  </Template>
</TemplatesExport>
by Hadi Eskandari   January 31, 2011 @ 11:38pm
327 Views
no comments
 
C#
 
var realHandler = GetHandler<SomeType>();
var message = GetMessage(); //Returns derived type of SomeType
var handlerType = typeof(IHandler<>);
var genericType = message.GetType();
var genericHandler = handlerType.MakeGenericType(genericType);
 
return realHandler --> as genericHandler would not work
by Hadi Eskandari   July 19, 2010 @ 8:45am
Tags: Generics
181 Views
no comments
 
C#
public IResult GetResultTree()
{
    return new WebServiceResult<CampaignSessionBeanClient, GetCampaignTreeResultCompletedEventArgs>(x => x.GetCampaignTreeResultAsync(GetCampaignFilter()), x =>
    {
        var propsals = new ProposalMapper().MapMany(x.Result);
        var Agencies = from agc in propsals
                       group agc by agc.Agency.OrgOrgRoleId into agcGroup 
                       select new
                       {
                           OrgOrgRoleIdAgc = agcGroup.Key,
by Hadi Eskandari   February 19, 2010 @ 11:20pm
250 Views
no comments
 
@Stateless(name = "UserSessionEJB")
@RemoteBinding(jndiBinding = "UserSessionRemote")
@Remote(UserSessionRemote.class)
@WebService
public class UserSessionBean implements UserSessionRemote {
    @PersistenceContext
    protected EntityManager em;
 
    @WebMethod
    public List<Users> getAllUsers() {
by Hadi Eskandari   January 17, 2010 @ 5:34am
Tags: Java, EJB 3.0
175 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate