A Derive UserAuth force me to reference ServiceStack in my Xamarin Apps

I derived my CustomUserAuth from UserAuth

Then in my Xamarin Apps I use ssutil.exe to have access to my DTOS.
So now I need to include ServiceStack in my xamarin apps. I think it’s not suppose to…

Should I implement my CustomUserAuth base on IUserAuth in my backend instead of derive it from UserAuth ?
I created a service in my Backend so the Xamarin Apps can retrieved and update my CustomUserAuth and another one-to-one table for extra details…

using System;
using ServiceStack.Auth;

namespace LanBO.ServiceStack
{
    public class CustomUserAuth: UserAuth    <----- IUserAuth
    {
        public CustomUserAuth() 
        {
            RowId = Guid.NewGuid();
        }
        //public virtual string Password { get; set; }
        public virtual int AuthenticatedTimes { get; set; }
        public Guid RowId { get; set; }
    }
}

Thanks!

You wont be able to reference the server ServiceStack.dll in Mobile Apps, the recommended approach is to copy what you need from your Session into your custom POCO and return that instead.

The Auto Mapping Utils should make this easy, e.g:

return session.ConvertTo<MySession>();
1 Like