Sunday, February 13, 2011

Understanding ASP NET ORM 101

LINQ stands for language integrated query. It allows you to use "SQL style" query language directly within C# to extract information from data sources.

  • That data source could be a SQL server database - this is Linq to SQL
  • That data source could be an data context of entity framework objects - Linq to entities.
  • That data source could be ADO.net data sets - Linq to Dataset.

That data source could also be an XML file - Linq to XML.
Or even just a Collection class of plain objects - Linq to Objects.

LINQ describes the querying technology, the rest of the name describes the source of the data being queried.

For a bit of extra background:

Datasets are ADO.net objects where data is loaded from a database into a .net Dataset and Linq can be used to query that data after it's loaded.

With Linq to SQL you define .net classes that map to the database and Linq-to-SQL takes care of loading the data from the SQL server database

And finally the Entity framework is a system where you can define a database and object mapping in XML, and can then use Linq to query the data that is loaded via this mapping.

And also

  • all of them are LINQ - Language Integrated Query - so they all share a lot of commonality. All these "dialects" basically allow you to do a query-style select of data, from various sources.

  • Linq-to-SQL is Microsoft's first attempt at an ORM - Object-Relational Mapper. It supports SQL Server only. It's a mapping technology to map SQL Server database tables to .NET objects.

  • Linq-to-Entities is the same idea, but using Entity Framework in the background, as the ORM - again from Microsoft, but supporting multiple database backends

  • Linq-to-DataSets is LINQ, but using is against the "old-style" ADO.NET 2.0 DataSets - in the times before ORM's from Microsoft, all you could do with ADO.NET was returning DataSets, DataTables etc., and Linq-to-DataSets queries those data stores for data. So in this case, you'd return a DataTable or DataSets (System.Data namespace) from a database backend, and then query those using the LINQ syntax

Saturday, January 8, 2011

MACOSX SVN 101

MACOSX SVN 101

1.Light up your terminal window

2.Add the following line into your .bash_profile , save it and quit

export SVN_EDITOR="/usr/bin/vim"

3.Check your changes by reloading Terminal and printing the SVN_EDITOR environment variable to screen by using the following
echo $SVN_EDITOR

It should output: /usr/bin/vim

4.To import files into your SVN

svn import project https://[PROJECT_NAME].googlecode.com/svn./trunk/ -m "initial import" --username [GMAIL_ACCOUNT_NAME]

5.To checkout the files from your SVN

svn checkout https://[PROJECT_NAME].googlecode.com/svn/trunk/ [PROJECT_NAME] --username [GMAIL_ACCOUNT_NAME]

6.Basic SVN work cycle
The typical work cycle looks like this:
1. Update your working copy.
• svnupdate
2. Make changes.
• svnadd
• svndelete
• svncopy
• svnmove
3. Examine your changes.
• svnstatus
• svndiff
4. Possibly undo some changes.
• svnrevert
5. Resolve conflicts (merge others' changes).
• svnupdate
• svnresolve
6. Commit your changes.
• svncommit