1. Martin Eden
  2. FrameLog
  3. Issues
Issue #35 resolved

Need Help Implementing FrameLog on App with No User Table

Rico Marcelo
created an issue

Hello,

I am developing an ASP.NET MVC app with no User table since user info is obtained from different source. So what I need is to tweak FrameLog to just record "Username" and maybe "Role" which are string fields. I am wondering how I can accomplish this.

Thanks.

Comments (11)

  1. Martin Eden repo owner

    Well, there a couple of approaches you could take.

    Firstly, you could just record Username. If you do that, just parameterize the interfaces with string - IChangeSet<string>, IObjectChange<string> and so on. I haven't tested this, but it should work; let me know how it goes.

    Alternatively, you could just create a User table and use it as a way of recording logging information, even if you don't use it for authentication. Just create some class like

    public class User : IHasLoggingReference
    {
        [Key]
        public virtual string Username { get; set; }
        public virtual string Role { get; set; }
    
        public string Reference
        {
            get { return Username; }
        }
    }
    

    and construct it and pass it in to FrameLogModule when saving changes. FrameLog/EntityFramework.

  2. Martin Eden repo owner

    So you are saying that it has automatically created two columns in the ChangeSet table: Author_Username and Author_Role? I did not know Entity Framework could do that.

    I'd love to see the code you used to achieve this. Or an extract of the logging table. This is unexpected behaviour as far as I am concerned.

  3. Log in to comment