public WebHookSession ToRepositoryType(IRepositoryModelCache cache, IComputerRepository computerRepository) { var result = new WebHookSession( computer: ComputerModel.ToRepositoryType(cache, Computer_Id, computerRepository), id: Id, lastPing: LastPing, token: Token ); cache?.Set(result.Id, result); return(result); }
public Network ToRepositoryType(IRepositoryModelCache cache, IComputerRepository computerRepository, IUserRepository userRepository) { var result = new Network( address: Address, attatchedComputer: ComputerModel.ToRepositoryType(cache, AttatchedComputer_Id, computerRepository), devices: null, id: Id, lastPing: LastPing, name: Name, owner: UserModel.ToRepositoryType(cache, Owner_Id, userRepository) ); cache?.Set(result.Id, result); return(result); }
public Task ToRepositoryType(IRepositoryModelCache cache, IComputerRepository computerRepository, IScriptRepository scriptRepository, IUserRepository userRepository) { var cachedValue = cache?.Get <Task>(Id); if (cachedValue != null) { return(cachedValue); } var result = new Task( expiration: Expiration, id: Id, origin: Origin, owner: UserModel.ToRepositoryType(cache, Owner_Id, userRepository), receivedTimestamp: ReceivedTimestamp, script: ScriptModel.ToRepositoryType(cache, Script_Id, scriptRepository), target: ComputerModel.ToRepositoryType(cache, Target_Id, computerRepository) ); cache?.Set(result.Id, result); return(result); }