Tags » C#

What is .Net Frame work ? (A simple description)

The .NET Framework is a  platform created by Microsoft for Software developing.It has lot of versions,new released version is 4.6 (April-2016).

Microsoft Definition: A programming infrastructure created by Microsoft for building, deploying, and running applications and services that use .NET technologies, such as desktop applications and Web services. 388 more words

SelectListItem Helper to create selectlistitems from enum

first, we create a extension method to get the descriptions of enum values.

public static string ToDescription<T>(this T enumValue)
            where T : struct, IConvertible, IComparable, IFormattable // Criteria for Enums
        {
            var fieldInfo = enumValue.GetType().GetField(enumValue.ToString());
            var attributes = fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false).Cast<DescriptionAttribute>().ToList();
            return attributes.Any() ? 110 more words
C#

Override EF 5 database mapping

public class UserRepo
{
    private UserContext _context;
    public UserRepo(UserContext context)
    {
        _context = context;
    }
 
    public User Save(User user)
    {
        if (user.Id <= 0)
        {
            _context.Users.Add(user);
        }
        else
        {
            _context.Users.Attach(user);
        }
        return user;
    }
}
 
public class User
{
    public int Id { get; set; }
    public string Name { get; set; }
}
 
public class UserMapping : EntityTypeConfiguration<User>
{
    public UserMapping()
    {
        HasKey(p => p.Id);
        Property(p => p.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity).HasColumnName("Id");
        Property(p => p.Name).HasMaxLength(100);
 
        ToTable("User");
    }
}
 
public class UserContext : DbContext
{
    public DbSet<User> Users { get; set; }
 
    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        modelBuilder.Configurations.Add(new UserMapping());
    }
 
    public UserRepo UserRepo
    {
        get
        {
            return new UserRepo(this);
        }
    }
}
C#

Introduction to MongoDb with .NET part 36: other bits and pieces about the query plan

Introduction

In the previous post we looked at a couple of options we can provide when creating an index. With a unique index we can ensure that only unique values can be inserted on a property. 1,643 more words

C#

The size_type problem and auto to the rescue

Have you found yourself with a simple piece of code like this behaving differently when you switch the platform or machine running it?

std::vector<int> v;

unsigned mysize = v.size(); 213 more words
Auto

2D Game with Cocos2d-x

1. Have two backgrounds scrolling in parallax scrolling with Painter’s algorithm.

2. Incorporate data-driven programming for info in XML. Program gamedataLoader with singleton design pattern. 49 more words

2D Game

Le le le le bahaar mein bahaar ke maze

This article is meant to be posted in atulsongaday.me. If this article appears in sites like lyricstrans.com and ibollywoodsongs.com etc then it is piracy of the copyright content of atulsongaday.me and is a punishable offence under the existing laws. 350 more words

Yearwise Breakup Of Songs