Search Results

Search found 2 results on 1 pages for 'bigtommy79'.

Page 1/1 | 1 

  • Fluent NHibernate: Example of a one-to-many relationship on an abstract class of a table-per-subclas

    - by BigTommy79
    Hi All, I've been trying for ages to find an example (because I can't get it to work myself) of the correct mapping for a one-to-many relationship on an abstract class of a table-per-subclass implementation, in fluent nHibernate. An example below: I'm looking to map the list of Fines on the Debt abstract base class to the Fine class. if anyone knows of any tutorial or example they've come across before please let me know. Thanks, Tim public abstract class Entity { public int Id { get; set; } } public abstract class Debt : Entity { public decimal Balance { get; set; } public IList<Fine> Fines { get; set; } public Debt() { Fines = new List<Fine>(); } } public class CarLoan : Debt { } public class CreditCard : Debt { } public class LoanApplication : Entity { public IList<Debt> ExistingDebts { get; set; } public LoanApplication() { ExistingDebts = new List<Debt>(); } } public class Fine { public Int64 Cash { get; set; } }

    Read the article

  • MVC3 html.TextBox

    - by BigTommy79
    I have login view that takes a LoginPageViewModel: public class LoginPageViewModel : PageViewModel { public string ReturnUrl { get; set; } public bool PreviousLoginFailed { get; set; } public LoginFormViewModel EditForm { get; set; } } which is rendered in the view. When a user tries to log in I only want to post the LoginFormViewModel (Model.EditForm) to the controller: public ActionResult Login(LoginFormViewModel loginDetails) { //do stuff } Using Html.TextBox I can specify the name of the form field manually 'loginDetails.UserName' and post back to the controller and everything works. @model Web.Controllers.User.ViewModels.LoginPageViewModel @using (Html.BeginForm()){ @Html.Hidden("loginDetails.ReturnUrl", Model.ReturnUrl) @Html.LabelFor(x => x.EditForm.UserName, "User Name:") @Html.TextBox("loginDetails.UserName", Model.EditForm.UserName) @Html.ValidationMessageFor(x => x.EditForm.UserName) ..... But what I want to do is to use the staticaly typed helper, something like: @Html.TextBoxFor(x => x.EditForm.UserName) But I'm unable to get this to work. Are you only able to post back the same model when useing the strongly typed helpers? Is there something I'm missing on this? Intellisense doesn't seem to give any clues such as a form field string.

    Read the article

1