locked
How to conditionally create table row RRS feed

  • Question

  • I'm using Silverlight with WCFRIA and the MS SQL Server based authentication/authorization feature that comes with the VS Silverlight business template.

    I want to implement a log that records the time every time a user logs into my site. I have a browser resident delegate that executes when someone logs in and I will use the [Invoke] feature to call my serve resident code with the username. I want to look in the log table to see if this is the first time this user has logged in and if so, insert the username into a table and insert the current time into a second table to make one-to-many table between usernames and login/logout times.

    Since I've repeatedly had bad luck with generating the model from the database (it appears the authorization/authentication feature was not designed to be imported into Entity Framework) I'm inclined to just make a new table of user names that is semi-redundant with the tables generated by the SQL Server based authentication/authorization feature. Has anyone had any luck using the username userprofile tables generated by the authentication/authorization feature with Entity Framework? Every I generate a model from them I cannot compile and I have to start over.

    I'm using model first.

    I know how to define this in the visual studio modeler. I know how to do it in TSQL. I'm not sure how to do it using Entity Framework and C#. Do I have my choice between using C# LINQ and the Entity SQL?

    Can someone give me some guidance?


    siegfried heintze



    • Edited by siegfried_ Friday, July 12, 2013 6:39 AM
    Friday, July 12, 2013 6:34 AM

Answers