Adding Create ActionResult (2)

What should being coded in Try function?

The idea is populating a new object with user input, then insert it to database. Actually, it looks alike with creating a new genre.

Song song = new Song()
{
    Title = model.Title,
    Singer = model.Singer,
    Writer = model.Writer,
    Year = model.Year,
    GenreId = model.GenreId
};

context.Songs.InsertOnSubmit(song);
context.SubmitChanges();
return RedirectToAction("Index");

results matching ""

    No results matching ""