public static UserStateInfo Login(AuthParameterInfo loginInfo) { AuthParameter parameter = loginInfo.MappingTo <AuthParameter>(); UserState state = User.CreateState(parameter); if (state == null) { return(null); } return(state.MappingTo <UserStateInfo>()); }
public ServiceResult <UserStateInfo> Login(AuthParameterInfo parameter) { parameter.AppIp = Context.Request.UserHostAddress; parameter.DeviceId = parameter.DeviceId ?? parameter.Ip; UserStateInfo state = UserAdapter.Login(parameter); if (state != null) { return(new ServiceResult <UserStateInfo>(state)); } else { return(new ServiceResult <UserStateInfo>(ServiceState.InvalidUserCredentials)); } }