Implementing code first model in mvc 3 [closed] - c#

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm trying to use code first model for my simple blog site, I'm used to with database first, but an experienced guy told me to use code first, but I'm having lots of trouble to implement this, even the simplest thing like setting identity to the key value, defining relation between two entity, handling image type data. I do want to understand the inside out of this approach, I tried to search quite a lot, but didn't get the desired information. Can someone please help me with the information like where to start, how to proceed & get expertize on the code first model?
Thanks in advance.

Check out this: Entity Framework Code First to Database on MSDN.
Even better, the tutorial uses a Blog as the example application.

There are tons of tutorial out there on code-first approach.
you can start with asp.net mvc official site: http://www.asp.net/mvc
here is another tutorial: http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-1 (Code First Approach)
and you can find a lot projects here: http://www.codeplex.com/ you just need to search

Related

i need to be on the line to create data using sql that stores articles [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
i need to be on the line to create database using sql that stores articles .. like news.. in other words the data base should have image and title of the article and autonumber id for the article and its category id and the text .. my website design is ready and im using visual studio 2010 c# .. i need each article have link and when i press it view it with its image and its body text and its title .... sorry for my language .. if any one can help me with hints or links it'll be great ..
You need to read FAQ and How to Ask
Regarding your question.
How is that you have your website ready without having any idea of how to handle the data and save it in the Database?
You have done a very generic question, without giving any information of how you have solved your issues so far, or what technologies you are using.
There is tons of ways of doing what you want.
I would suggest that you use either Entity Framework or NHibernate.
Then maybe look samples on how to implement CRUD with them.

Url Mapping with asp.net [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm creating a site, and i need to have my urls mapped . I want to avoid losing css during mapping. I want something like this..
http://www.vitagamer.net/Game.aspx?id=12
to
http://www.vitagamer.net/games/this-is-a-game-name/
now I've been thinking about the following algorithm..
receive the requested url..
break into parts, and search database for id associated with "this-is-a-game-name".
serve the http://www.vitagamer.net/game.aspx?id=12 page
I've been looking on the web but i'm confused. How do I do the mapping?
how many ways are there?
is there a difference between rewriting and mapping?
Update
I also need to add hyperlinks to my pages that are shown like
http://www.vitagamer.net/games/gamename/
should I just do things with strings? or there's a more efficient way.
As you seem to be on Asp.Net WebForms, I would suggest writing a HttpModule to catch the incoming requests and rewrite the URLs.
This is a duplicate question and I've found my suggested answer as the second one here: ASP.NET URL Rewriting
You should look into Microsoft.AspNet.FriendlyUrls to easily use routing and get "friendly urls" or "extensionless urls" for ASP.Net Web Forms.
Here's a primer from Scott Hanselman
IIS 7 has support for URL Rewrite, you can use IIS interface to manage URL(s):
http://www.iis.net/downloads/microsoft/url-rewrite

graphical representation of source code [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have some source code in C# that lies in a number of folders.
I need to understand this code as it wasn't written by me. Not only that, I want to learn how enterprise applications are coded. The best way to do that is if I have a graphical representation of classes, inheritance etc. I should be able to see the source code in multiple layers: e.g how classes relate to each other, how properties/methods in these classes relate and call each other, etc. I've heard of enterprise architecture and checked it out, but I don't understand what I've read.
Can anyone suggest something else?
Have you looked at NDepend? It can show you all the dependencies withing the code - eg through graphs;
http://www.ndepend.com
Simply use Microsoft Debug Canvas to get acquainted with the solution.
If you are using Visual Studio right click on project and choose "View Class Diagram".

What are the best resources for ASP.NET + C#? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Edit: (Being more concise to avoid rubbing up against other questions)
I see the link for some suggested books... Books are good but I prefer the web. I can try them out free right away. And I'm a guy that likes multiple sources of information either way.
I am also a big believer in tutorials over just reading. Something I can try out and then modify or do my own way. (I just made a blog in PHP/Zend since that was originally going to be the project language)
And I didn't see what made the best references (which is in my mind entirely different from a learning resource). Though I'm sure I'll figure this out naturally as I google issues that crop up.
There's this website called Stackoverflow that's pretty good
According to MS: http://www.asp.net/
Theres also channel 9: http://channel9.msdn.com/
I enjoy Pluralsight's video offerings and TechEd online videos.
Another good resource is 4GuysFromRolla.
Microsoft has a Beginners' Learning Center.
For paid training, Pluralsight (mentioned above) and TekPub are both highly rated.

iTemplate what is it and place where i can get GOOD example in c# [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
HI ,
I am currently trying to learn more about custom controls and how to use them etc. i have come across iTemplate interface and was hoping that someone could better explain its use and point me toward a good example implementation. From what i have found it allows you to change how an asp.net control will display items. ive tried searching code project etc for a good example but none explain it well. Id ideally like a very basic example and a more complex one.
thanks
Niall
ITemplate: Defines the behavior for populating a templated ASP.NET server control with child controls. The child controls represent the inline templates defined on the page. (taken from MSDN).
Take a look at these great tutorials: Developing Custom ASP.NET Server Controls or Templated Server Control Example.

Categories