Dev2.Runtime.ServiceModel.EmailSources.Get C# (CSharp) Method

Get() public method

public Get ( string resourceId, System.Guid workspaceId, System.Guid dataListId ) : EmailSource
resourceId string
workspaceId System.Guid
dataListId System.Guid
return Dev2.Runtime.ServiceModel.Data.EmailSource
        public EmailSource Get(string resourceId, Guid workspaceId, Guid dataListId)
        {
            var result = new EmailSource();
            try
            {
                var xmlStr = ResourceCatalog.Instance.GetResourceContents(workspaceId, Guid.Parse(resourceId)).ToString();
                if(!string.IsNullOrEmpty(xmlStr))
                {
                    var xml = XElement.Parse(xmlStr);
                    result = new EmailSource(xml);
                }
            }
            catch(Exception ex)
            {
                RaiseError(ex);
            }
            return result;
        }

Usage Example

        public void EmailSourcesGetWithInvalidArgsExpectedReturnsNewSource()
        {
            var handler = new EmailSources();
            var result = handler.Get("xxxxx", Guid.Empty, Guid.Empty);

            Assert.IsNotNull(result);
            Assert.AreEqual(Guid.Empty, result.ResourceID);
        }
All Usage Examples Of Dev2.Runtime.ServiceModel.EmailSources::Get