Exemple #1
0
        /// <summary>
        /// Opprett ad-hoc tilgangsgruppe for sak.
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <param name="sak">The sak.</param>
        /// <param name="personIds">The person ids.</param>
        /// <returns></returns>
        public static int OpprettTilgangsgruppe(this IFunctionManager instance, Sak sak, params int[] personIds)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

            if (sak == null)
            {
                throw new ArgumentNullException("sak");
            }

            if (personIds == null || personIds.Length == 0)
            {
                throw new ArgumentException(@"Det må angis minst ett medlem av tilgangsgruppen.", "personIds");
            }

            return((int)instance.Execute("OpprettTilgangsgruppeHandler", sak.Id, 0, string.Join(",", personIds.Select(x => x.ToString()).ToArray())));
        }
        /// <summary>
        /// Opprett ad-hoc tilgangsgruppe for sak.
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <param name="sak">The sak.</param>
        /// <param name="personIds">The person ids.</param>
        /// <returns></returns>
        public static async Task <int> OpprettTilgangsgruppeAsync(this IAsyncFunctionManager instance, Sak sak, params int[] personIds)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

            if (sak == null)
            {
                throw new ArgumentNullException("sak");
            }

            if (personIds == null || personIds.Length == 0)
            {
                throw new ArgumentException(@"Det må angis minst ett medlem av tilgangsgruppen.", "personIds");
            }

            return((int)await instance.ExecuteAsync("OpprettTilgangsgruppeHandler", sak.Id, 0, string.Join(",", personIds.Select(x => x.ToString(CultureInfo.InvariantCulture)).ToArray())));
        }