/// <summary> /// Creates a new resource in the model and its backing RDF store. Provides a resource object of the given type. /// </summary> /// <param name="t">Type of the resource object. Must be derived from Resource.</param> /// <param name="format">The format of the resulting uri.</param> /// <param name="transaction">Transaction associated with this action.</param> /// <returns>An instance of the given object type wrapping the newly created resource.</returns> /// <exception cref="ArgumentException">Throws ArgumentException if a resource with the given URI already exists in the model.</exception> public virtual object CreateResource(Type t, string format = "urn:uuid:{0}", ITransaction transaction = null) { return(CreateResource(UriRef.GetGuid(format), t, transaction)); }
/// <summary> /// Creates a new resource in the model and its backing RDF store. Provides a resource object of the given type. /// </summary> /// <param name="t">Type of the resource object. Must be derived from Resource.</param> /// <param name="format">The format of the resulting uri.</param> /// <param name="transaction">ransaction associated with this action.</param> /// <returns>An instance of the given object type wrapping the newly created resource.</returns> /// <exception cref="ArgumentException">Throws ArgumentException if a resource with the given URI already exists in the model.</exception> public object CreateResource(Type t, string format = "http://semiodesk.com/id/{0}", ITransaction transaction = null) { return(CreateResource(UriRef.GetGuid(format), t, transaction)); }
/// <summary> /// Creates a new resource in the model and its backing RDF store. Provides a resource object of the given type. /// </summary> /// <typeparam name="T">Type of the resource object. Must be derived from Resource.</typeparam> /// <param name="format">The format of the resulting uri.</param> /// <param name="transaction">Transaction associated with this action.</param> /// <returns>An instance of the given object type wrapping the newly created resource.</returns> /// <exception cref="ArgumentException">Throws ArgumentException if a resource with the given URI already exists in the model.</exception> public virtual T CreateResource <T>(string format = "urn:uuid:{0}", ITransaction transaction = null) where T : Resource { return(CreateResource(UriRef.GetGuid(format), typeof(T), transaction) as T); }
/// <summary> /// Creates a new resource in the model and its backing RDF store. Provides a resource object of the given type. /// </summary> /// <typeparam name="T">Type of the resource object. Must be derived from Resource.</typeparam> /// <param name="format">The format of the resulting uri.</param> /// <param name="transaction">ransaction associated with this action.</param> /// <returns>An instance of the given object type wrapping the newly created resource.</returns> /// <exception cref="ArgumentException">Throws ArgumentException if a resource with the given URI already exists in the model.</exception> public T CreateResource <T>(string format = "http://semiodesk.com/id/{0}", ITransaction transaction = null) where T : Resource { return(CreateResource(UriRef.GetGuid(format), typeof(T), transaction) as T); }