Tags: , , , , , , , | Categories: development, development Posted by pieterg on 3/10/2010 7:51 AM | Comments (49)

Isn’t symmetry nice? I always have some OCD when it comes to diagrams. So, it’s not surprise when you see this screenshot of the Linq2Sql Contextathena_dbml

Along with this, now we can go ahead and create Athena.DAL which contains the Linq2Sql context.

The solution isn’t that far long, so I won’t put up any code yet.

From this fantastic post on implementing the Repository pattern using Linq2SQL, we quickly put together some code that resembles the following

The Repository Interface

namespace Athena.DAL
{
	/// <summary>
	/// Repository Contract
	/// </summary>
	public interface IRepository<TRow, TEntity>
		where TRow : class
	{
		#region Find
		IList<TEntity> Find(Expression<Func<TRow, bool>> exp);
		TEntity FindSingle(Expression<Func<TRow, bool>> exp);
		#endregion

		#region Save
		void Save(TEntity entity);
		#endregion

		#region Delete
		void Delete(TEntity entity);
		#endregion
	}
}

Our Entry Model, which will describe an Entry fully

namespace Athena.DAL
{
	/// <summary>
	/// Entry Model
	/// </summary>
	public class EntryModel
	{
		public Entry Entry { get; set; }
		public List<Tag> Tags { get; set; }
		public List<Category> Categories { get; set; }
	}
}

and now for our not yet implemented EntryRepository

namespace Athena.DAL
{
	/// <summary>
	/// Entry Repository
	/// </summary>
	public class EntryRepository : IRepository<Entry, EntryModel>
	{
		#region Find
		/// <summary>
		/// Find
		/// </summary>
		/// <param name="exp"></param>
		/// <returns></returns>
		public IList<EntryModel> Find(System.Linq.Expressions.Expression<Func<Entry, bool>> exp)
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// Find Single
		/// </summary>
		/// <param name="exp"></param>
		/// <returns></returns>
		public EntryModel FindSingle(System.Linq.Expressions.Expression<Func<Entry, bool>> exp)
		{
			throw new NotImplementedException();
		}
		#endregion

		#region Save
		/// <summary>
		/// Save
		/// </summary>
		/// <param name="entity"></param>
		public void Save(EntryModel entityModel)
		{
			throw new NotImplementedException();
		}
		#endregion

		#region Delete
		/// <summary>
		/// Delete
		/// </summary>
		/// <param name="entity"></param>
		public void Delete(EntryModel entityModel)
		{
			throw new NotImplementedException();
		}

		#endregion
	}
}

Comments

guitar lessons for beginners
guitar lessons for beginners United States on 2/18/2010 4:08 AM i know i'm a little off topic, but i just wanted to say i like the layout of your blog. i'm new to the blogegine platform, so any suggestions on getting my blog looking better would be appreciated.
Cheap Computers
Cheap Computers Canada on 2/19/2010 2:25 PM Thank you for another fantastic blog. Where else could I get this kind of information written in such an incite full way? I have a project that I am just now working on, and I have been looking for such information... Regards… http://www.pctechoutlet.com
learn to play guitar
learn to play guitar United States on 2/20/2010 12:12 AM i am subscribing. thanks
tratwy
tratwy Poland on 2/21/2010 4:32 AM Thanks for good article. Hope to see more soon.
migliori Jackpot dei casinò in rete
migliori Jackpot dei casinò in rete India on 3/5/2010 7:04 PM I think all code should be written with maintainability and readability in mind at all times, especially if it is in the team’s repository. I don’t believe it is feasible to do the above tasks you mentioned every time you need to pass on your work.
current health articles
current health articles United States on 3/8/2010 12:51 PM Apple now has Rhapsody as an app, which is a great start, but it is currently hampered by the inability to store locally on your iPod, and has a dismal 64kbps bit rate. If this changes, then it will somewhat negate this advantage for the Zune, but the 10 songs per month will still be a big plus in Zune Pass' favor.
fat loss 4 idiots review
fat loss 4 idiots review United States on 3/9/2010 10:47 PM can anyone tell me how to get those little avatars to appear in my comments section? thank you!
fibroids surgery
fibroids surgery United States on 3/10/2010 1:57 AM Hands down, Apple's app store wins by a mile. It's a huge selection of all sorts of apps vs a rather sad selection of a handful for Zune. Microsoft has plans, especially in the realm of games, but I'm not sure I'd want to bet on the future if this aspect is important to you. The iPod is a much better choice in that case.
womens plus size denim blazers
womens plus size denim blazers United States on 3/10/2010 3:56 AM I normally dont stop to leave comments, however it is hard to find actual thoughts on this topic today. You did a fantastic job in this post and I am going to look at the rest of your blog. Keep writing!
cord blood banking
cord blood banking United States on 3/11/2010 8:19 PM If you're still on the fence: grab your favorite earphones, head down to a Best Buy and ask to plug them into a Zune then an iPod and see which one sounds better to you, and which interface makes you smile more. Then you'll know which is right for you.
theme song rocky
theme song rocky Canada on 3/13/2010 6:38 PM Thanks for sharing this nice article. Well looking for downloading free music then you can also use free-mp3.ca , its new toolbar allows to convert you tube videos to mp3
http://www.free-mp3.ca/
santam insurance
santam insurance United States on 3/13/2010 7:10 PM I was very impressed. Thank you dear. You are very good. The article was nice to read and full of meaning full of knowledge
Resume Templates
Resume Templates United States on 3/14/2010 1:58 AM I am too.  this is very helpful.
best exercise dvds
best exercise dvds United States on 3/14/2010 9:19 AM We should get in touch. Are you an active user on social networking sites like Digg, Facebook, or Stumble Upon? If so, what's your username so we can get in touch to share ideas.
Reverse Cell Phone Lookup
Reverse Cell Phone Lookup Canada on 3/15/2010 4:40 AM Interesting post Smile I should really be working
momentum health
momentum health United States on 3/15/2010 5:10 AM Thanks for the interesting post!
momentum multiply
momentum multiply United States on 3/15/2010 8:56 AM Great post! Thanks for the information
Rocky Chynoweth
Rocky Chynoweth Peru on 3/15/2010 7:49 PM Whats happening, I found this site about asp.net by mistake when I was going through Aol after that I arrived to your web site. I have to say your internet site is interesting I really like your theme! Now I don�t have the free time at the present moment to fully look through your sitebut I have bookmarked it. I will be back in a day or 2 . Thanks for a good site.
Kindra Darlin
Kindra Darlin Netherlands on 3/16/2010 6:09 AM I have been surfingonline at least 3 hours today, however I never found any interesting piece similar to yours about asp.net It really is pretty worth enough for me. In my view, if every web owners and bloggers made good content as you did, the web is going to be much more practical than ever before.
Johnathan Sybounheuan
Johnathan Sybounheuan Slovenia on 3/16/2010 12:02 PM Dude.. I'm not a great deal into reading about asp.net , but somehow I got to read several posts in your webpage. Its superb how interesting it is for me to visit you very often.
Long Gentes
Long Gentes Thailand on 3/17/2010 1:15 AM I have been surfingonline just above three hrs today, until now I by no means found any attractive piece similar to yours about asp.net It really is pretty worth enough for me. Individually, if every web owners and bloggers made excellent content as you did, the internet will likely be so much more useful than ever before.
blacklisted
blacklisted United States on 3/17/2010 2:00 AM Nice post thanks.
Nidia Broyhill
Nidia Broyhill United States on 3/17/2010 11:23 AM I really like your post. Always been very informational. I hope you'll keep up the good work and maintain the standard. Best of luck.
auto insurance
auto insurance United States on 3/17/2010 11:25 AM I was very impressed. Thank you dear. You are very good. The article was nice to read and full of meaning full of knowledge
Sina locksmith
Sina locksmith Brunei Darussalam on 3/17/2010 3:14 PM Man.. I'm not a great deal into reading about asp.net , but somehow I got to read a great deal of articles on your blog. Its amazing how interesting it is for me to visit you very often.
Brandon locksmith
Brandon locksmith Kuwait on 3/17/2010 8:51 PM I was thinking what's up with that eerie gravatar??? I do know  5am is early & I am not looking my greatest at that hr, but I hope I don't seem like this! I'd however make that face if I am asked to do 100 pushups. :-|Smile}
computers keyboard
computers keyboard United States on 3/20/2010 9:41 AM I would like to say this is an excellent blog that I have ever come across. Very informative. Please write more so that we can get more details.
Sport Supplement
Sport Supplement United States on 3/21/2010 8:02 AM I have spent quite some time to eventually stumble on your blog post about this topic. Great work.
philadelphia locksmith
philadelphia locksmith Hungary on 3/21/2010 10:39 PM Hello, I�m fairly impressed by your blogging talent about asp.net . Please make contact with me if a part-time running a blog career sounds like some thing you�d be thinking about
AVG Antivirus Review
AVG Antivirus Review United States on 3/23/2010 1:46 AM Thank you for this helpfull review. It really was helpfull. Keep up the good work.
locksmith
locksmith Islamic Republic of Pakistan on 3/23/2010 7:20 PM asp.net asp.net asp.net Do you accept guest posts? I would like to write down couple articles here.
locksmith 24 hours
locksmith 24 hours Morocco on 3/24/2010 2:14 AM Hello everybody. This weblog was fantastic! Lots of cool data & inspiration. Keep 'em coming... you all perform such a necessary job at writing... cannot tell you how much I, for one appreciate all you do! asp.net asp.net asp.net ROCKS
upholstered dining room chairs
upholstered dining room chairs United States on 3/24/2010 2:51 AM I hope this comment doesn't turn up various times (it seems to hang up once I make an effort to post my comments... so I'm not sure if it's essentially being recorded), but all I actually planned to say... cool blog post ! And many thanks for sharing your thoughts..
hip hop beat
hip hop beat United States on 3/26/2010 6:36 AM I will try to implement the code that you put together that resembles the The Repository Interface that you gave on this article.
Thanks for the information and the nice diagram. I'll come back for more.
Rapidshare
Rapidshare United States on 3/26/2010 11:54 PM This document explains top file share services, their fundamentals and functionality, gives you an overall idea about Rapidshare and its abilities, describes Rapidshare search engines, how they work and how to benefit from using them, when searching for files and folders on Rapidshare.

Before we get to the description of Rapidshare search engines, get acquainted with this general top file share services services summary. As well as almost all world wide web users, you have undoubtedly heard of Rapidshare and similar services, invented to help people easily outspread documents, music, videos, software and other media and files via the web. Initially launched in German sector of the Internet in early 2000s , Rapidshare quickly turned into the most popular file share service in the world, which led to creation of an international version used by over 200 million people from 200 countries. As a result of popularity of this file share, first Rapidshare search engines were presented on the Internet about one year ago. If you\'re in need of sharing fresh pictures with your relatives and friends, if you need to send documents and files to your colleagues without sending separate copies to each e-mail, just use Rapidshare to let people quickly get all the files from any computer connected to the Internet.

Apart from this, you\'ve definitely came across plenty of blogs and forums sharing files through Rapidshare and Rapidshare search engines that help people finding files there. It helps saving bandwidth and provide file links to their visitors. As you can assume Rapidshare is a handy, world famous fileshare that helps people, businesses, artists, musicians and others easily, quickly and smoothly share content over the web.

At the same time, there is one lack. Rapidshare won\'t allow you to search for for files in their database. And despite of the fact that you know that a necessary file is definitely hosted on Rapidshare you can download it, you can\'t find it, because they don\'t have a built-in search engine.

At this point Rapidshare search engines become useful. Rapidshare search engines are alike to Google, Yahoo and other search engines with one important difference. They aren\'t indexing websites - they crawl Rapidshare, that\'s how you always get plain links without unnecessary garbage. Try Rapidshare search engine and you will most likely find all necessary content in several seconds!

Now, let\'s talk about general types of Rapidshare search engines available out there. Generally we can define and mark out three general variations: classic, advanced and full-featured rapidshare search engines. Basic search engines offer just a couple of plain services. Their pages usually contain just few necessary elements. And no additional helpful features. You just type a search term, hit search, look at the results and get the file. The most obvious lack of this family of websites is that they can\'t display related and linked files, they don\'t check files for consistency and they don\'t index other websites, except for Rapidshare. Basically they are good, however, they are not worth a penny. Next type crawls several Rapidshare search engines offering linked searches, check the files for availibility and consistency and suggest similar and linked content. Anyhow, they don\'t offer you to search on other fileshares and they won\'t provide you with many handy options of top sites. And finally leading Rapidshare search egines are providing you a maximum of possible services covering plenty of options and crawling almost all of the leading Internet file databases, including Rapidshare and its mirrors. As you can assume it is obvious that you must find a leading Rapidhsare search egnine to get all you need from this kind of sites.
Search on Rapidshare
Search on Rapidshare United States on 3/27/2010 12:49 AM This page explains top file share services, their concepts and functionality, provides you with interestig facts about Rapidshare and its abilities, describes Rapidshare search engines, the way they work and how to use them, when looking for for files and folders on Rapidshare.

Before getting acquainted with Rapidshare search engines, take a look at this general top file share services services observation. As almost all web users, you\'ve apparently heard of Rapidshare and other similar services, invented to help surfers easily retail docs, vids, music, soft and other media and files via the internet. First released in German web years ago, Rapidshare quickly turned into the most popular file share service in the world, which led to invention of an worldwide-targeted version used by over 200 million surfers worlwide. As a result of popularity of this file share, first Rapidshare search engines appeared on web less than one year ago. If you\'d like to share vacation photos with your friends, if you need to spread some files and documents with your colleagues without sending separate copies to each e-mail, just use Rapidshare to help people quickly download all the files from everywhere.

Other than this, you\'ve surely seen many blogs and forums distributing files via Rapidshare as well as Rapidshare search engines that help people searching for various files there. It helps saving bandwidth and allow their visitors download plenty of useful files. Therefore Rapidshare is a very helpful, very popular file distribution service that helps people, businesses, artists, musicians and others instantly share any data over the Internet.

At the same time, there is one lack. Rapidshare will not allow you searching for files on Rapidshare. And despite of the fact that you know that a necessary file is almost surely hosted on Rapidshare and you can get it, you are unable to find it, due to the fact that they didn\'t include a search engine in their services.

And that\'s where Rapidshare search engines appear to be useful. Rapidshare search engines are similar to other search engines with one important distinction. They do not index web pages - such engines only index Rapidshare and other fileshares, so therefore you always get plain links without garbageous pages. Give Rapidshare search engine a try and you will definitely find everything you need within several moments!

As a conclusion to the information above, let\'s talk about major types of Rapidshare search engines available out there. Basically we can outline three basic variants: old-style, modern and developing rapidshare search engines. Basic search engines offer just a couple of plain services. Their pages usually contain search string, tag cloud and a bit of most popular keywords. Nothing else. You type a keyword, hit the search button, get your results and download your file. Most obvious cons. of this kind of services is that they never show related files, they don\'t check the files for availibility and consistency and they don\'t index other websites, except for Rapidshare. They are good to find basic files, but to tell the truth, they\'re trash. Next type indexes more Rapidshare search engines offering linked searches, check the files for availibility and consistency and give hints about likely and linked objects. But despite of this advantage, they won\'t help you search on other fileshares and they miss many useful options of top services. And quality Rapidshare search egines are made to give you a maximum of possible options including many handy things and indexing many popular online file hostings, including Rapidshare and it\'s derivatives. As you can see it is questionless that you have to find a leading Rapidhsare search egnine to get the best experience with this type of search engines.
Sell your ipod
Sell your ipod United Kingdom on 3/27/2010 7:52 PM Thank you for this helpfull review. It really was helpfull. Keep up the good work. this article helped me.
Tristan Felman
Tristan Felman Luxembourg on 3/29/2010 11:09 PM Like your web page I'm going to subscribe
Sam Minskey
Sam Minskey Vietnam on 4/1/2010 11:52 AM You made some good points there about asp.net . I did a search on the topic and found many people will agree with your blog.
cord blood banking
cord blood banking United States on 4/3/2010 12:59 AM Zune and iPod: Most people compare the Zune to the Touch, but after seeing how slim and surprisingly small and light it is, I consider it to be a rather unique hybrid that combines qualities of both the Touch and the Nano. It's very colorful and lovely OLED screen is slightly smaller than the touch screen, but the player itself feels quite a bit smaller and lighter. It weighs about 2/3 as much, and is noticeably smaller in width and height, while being just a hair thicker.
tv glass stand
tv glass stand United States on 4/3/2010 11:24 PM Definitely a great post. Hats off to you! The information that you have provided is very helpful.
locksmith 24 hours
locksmith 24 hours Mongolia on 4/6/2010 4:43 PM
Free Reverse Cell Phone Directory
Free Reverse Cell Phone Directory United States on 4/8/2010 12:38 AM I don't know much about asp.net , but I read several posts in your site. Very interesting.
download free action games
download free action games United States on 4/8/2010 10:13 PM Cool article. Ive bookmarked it definitely.
Upholstered Dining Chairs
Upholstered Dining Chairs United States on 4/8/2010 10:48 PM Thanks for tutorial. Your posting is really help me. I get information what I search before.
locksmith center
locksmith center United States on 4/9/2010 12:48 PM Out of the ordinary post Smile
payday loans no faxing
payday loans no faxing United States on 4/9/2010 8:07 PM First of all thanks a lot for the informative and useful information. I have just been searching for some information about the Athena.DAL and accidentally I have noticed this your entry. Well, this website is really great and full of various and attractive information about everything, especially about. Thanks a lot one more time for the great and informative article and keep up publishing these great posts in the future too.
Carina Wraspir
Carina Wraspir Lithuania on 4/11/2010 6:50 AM Do you agree to guest posts? I would love to write down couple articles here.
electric beard trimmer
electric beard trimmer United States on 4/11/2010 10:29 AM I don't usually take the time to drop a comment, but it is hard to find good information on this topic today. You did a fantastic job in this post and I may just go read your other blog posts now. Keep writing!

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading