SourceSave() public static method

public static SourceSave ( Source source ) : Source
source Source
return Source
コード例 #1
0
        public static Source SourceAdd(int sourceId, SourceType sourceType, string name)
        {
            var source = SourceRepository.SourceNew(sourceId, sourceType, name);

            source = SourceRepository.SourceSave(source);

            return(source);
        }
コード例 #2
0
        public static Source SourceUpdate(int sourceId, SourceType sourceType, string name)
        {
            Source source;

            try
            {
                source = SourceRepository.SourceFetch(sourceId, sourceType);

                source.Name = name;

                source = SourceRepository.SourceSave(source);
            }
            catch
            {
                source = SourceRepository.SourceAdd(sourceId, sourceType, name);
            }

            return(source);
        }